Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

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

admin plugin plugins

Started by Kyle Alexander Buan 6 years ago · 0 replies · 1119 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 Marcel, 5 days ago
0 83 5 days ago
Support · by JakobDB, 6 days ago
1 89 5 days ago
Support · by ramenos, 7 days ago
3 103 6 days ago
Support · by gravinator, 2 weeks ago
3 228 7 days ago
Support · by Roger Parkinson, 2 weeks ago
3 308 2 weeks ago