I have a snippet that I created that creates a simple Edit this page link for users. The link goes to the Manager to edit current page.
I have been simply using this code to see if user can edit:
$modx->hasPermission('edit_document')
And if the user as the edit_document permission for the current context this will always return true, even if the current page is in a Resource Group that they do not have access to.
What I would like to have is a simple API call that is like (boolean) $modx->canEditResource() or something that you can choose the context and that this method calculates all the Resource Group permissions.
My question is what I am doing wrong? What already exists within the API that will accomplish what I am trying to do? Or do I need to create my own method to calculate the Resource Group perms?
Thanks for reviewing! Any help is appreciated! Let me know if I need to clarify.