Modules permissions

sdr1989 - 1 week ago

Hi everyone, I've created a couple of custom module in my pyrocms application, I would like to let the administrator choose the permissions (view, create, edit, delete) for other user, how can I add my custom module in the 'permissions' sections?

Thanks

Answer

ryanthompson - 1 week ago

Hey! If you are up to date and used the generators they should already have been created for you. But check this out for the default / auto-detect permissions: https://github.com/anomalylabs/pages-module/blob/2.3/resources/config/permissions.php

Read, write, and delete are all automatic (though you can manual test them too). And preview is a special case that's used like this: https://github.com/anomalylabs/pages-module/blob/2.3/src/Page/PageAuthorizer.php#L82-L84

ryanthompson - 1 week ago

Hey! If you are up to date and used the generators they should already have been created for you. But check this out for the default / auto-detect permissions: https://github.com/anomalylabs/pages-module/blob/2.3/resources/config/permissions.php

Read, write, and delete are all automatic (though you can manual test them too). And preview is a special case that's used like this: https://github.com/anomalylabs/pages-module/blob/2.3/src/Page/PageAuthorizer.php#L82-L84

sdr1989 - 1 week ago

@ryanthompson I'm using the last version but somehow the config folder wasn't created... anyway I followed your suggestion and now I'm set up! thank you so much!