Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

Preventing Page Creation/Editing/Saving on Specific Folders on Specific Accounts

admin plugin plugins

Started by Kyle Alexander Buan 6 years ago · 0 replies · 717 views
6 years ago

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

  1. Get the currently logged in user
  2. Determine if that user can actually create that page on that folder
  3. 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!

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 54 11 hours ago
Support · by Anna, 3 days ago
2 60 14 hours ago
Support · by Justin Young, 15 hours ago
1 30 15 hours ago
Support · by Duc , 1 week ago
2 65 5 days ago
Support · by Colin Hume, 1 week ago
2 57 5 days ago