Hi
Is it posible to create custom permissions and use them with the Permision class? I can't find it in the doc's!
Br. Mads
Hi
Is it posible to create custom permissions and use them with the Permision class? I can't find it in the doc's!
Br. Mads
Hi Mads,
Ehm. Custom permissions? I think you need to clarify what you want to do. It's probably possible without doing anything custom.
If you want to set permissions on a non-dynamicweb object, we can oblige out of the box:
Hi Martin
I think what you send me covers my version of "custom" permissions :-) We primary want to show/hide funktions in the front end depending on what usergroup you are in, is that posible?
When are you creating the permissions, they only have to be created once?
Br. Mads
Hi Mads,
Another good question. :)
We persist the permissions to a single database table, so it can be moved/cleaned/whatever. The important bits are the 3 key-values and the usergroupid:
You can even move the data from fx. Staging to Production, if you have such a setup. As long as the you "name" the composite keys in the same way, it will work out of the box.
You can even set up integration/something else to update this table if you need to (I sometimes just do it manually to test things). It's just plain data with a single value (PermissionLevel). Calculating the value needed in the PermissionLevel column in the database is a bit tricky, though. It follows the rules here: bitflag enums. Let me know if you need help with this.
Once you have a permission for a key-name-subname + userId, it is saved until you delete it.
Let me know how this works out.
BR
Martin
You must be logged in to post in the forum