We would like to limit the permission of other accounts so that they are only able to create/edit/delete pages on a certain folder.
Since Grav does not seem to have this permission feature implemented, I have been thinking of creating a hardcoded plugin for this.
It seems like the onAdminSave
event can be hooked into, but I was wondering how I can
- Get the currently logged in user
- Determine if that user can actually create that page on that folder
- Depending on the result, prevent the saving
We would like to also prevent editing and deletion of other pages but it seems like there is no such event such as onAdminDelete
, only onAdminAfterDelete
so is that even cancellable?
I would really appreciate even just a general guide on how to accomplish this, if possible.
Thank you very much in advance!