It's a bug in that version of NewsPublisher (and I think my code above is incorrect as well).
NewsPublisher is checking whether the user has 'edit_document' permission in the Context Access ACL entry, but it's not checking for the 'edit' permission on the particular resource (determined by the Resource Group Access ACL entry).
Here's the code from the new (soon-to-be-released) version:
Change this line:
/* check permissions on current page */
if (!$modx->hasPermission('edit_document')) {
$defaultButtonCaption = $modx->lexicon('np_no_edit_document_permission');
}
to this:
if (! ($modx->hasPermission('edit_document') && $modx->resource->checkPolicy('edit') ) ) {
if (! $modx->hasPermission('edit_document') ){
$defaultButtonCaption = $modx->lexicon('np_no_edit_document_permission');
} else {
$defaultButtonCaption = $modx->lexicon('np_no_edit_this_document_permission');
}
}
It should do what you expect if the ACL entries are set right, though you'll see the untranslated language string key for the second message in debug mode unless you create a new Lexicon entry in the NewsPublisher namespace for 'np_no_edit_this_document_permission'.
---------------------------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using . . . PLEASE!
MODX info for everyone:
http://bobsguides.com/modx.html
[ed. note: BobRay last edited this post 14 years, 7 months ago.]