shimmie2 icon indicating copy to clipboard operation
shimmie2 copied to clipboard

GUI Permission Editor

Open discomrade opened this issue 10 months ago • 3 comments

Making a proper feature request for this suggestion:

at some point I'd love to have a GUI permission editor, which might work as a form of documentation so one can see the effects of enabling or disabling each flag 🤔

Describe the solution you'd like A config page where the permissions of each role can be configured by administrators using checkboxes.

Special roles like admin should have their permissions visible with checkboxes greyed out. If a role has a parent role, this should be added using a dropdown box, so the user understands which parent role must be edited to remove an inherited permission, or can change the parent role.

In the future, this should be able to add new roles or delete unused roles.

discomrade avatar Apr 26 '24 03:04 discomrade

I've made a draft GUI editor. This involves moving the permissions to the database instead of being hardcoded or in a config file, which also requires moving UserClass code to an extension (so the database can load first).

There are a few code issues marked by TODO comments, the main one being some confusion over how to properly use boolean fields in the database.

https://github.com/shish/shimmie2/compare/main...discomrade:shimmie2:permissions

image

image

image

discomrade avatar May 07 '24 09:05 discomrade

This involves moving the permissions to the database instead of being hardcoded or in a config file

I wonder why this was in a config file in the first place, since being in the database certainly feels like a better idea... my gut is telling me that there was a reason, but I can't remember it 😅 If it's in the database in your branch, and everything is working fine there, maybe the reason disappeared at some point over the past few years...

shish avatar May 07 '24 11:05 shish

It could have been because the database code loads after core code. Everything seems to be working alright so hopefully the reason disappeared :)

discomrade avatar May 08 '24 06:05 discomrade