Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Custom Entity Permissions: Easily add new permissions to roles after initialization #206
Cofoundry only sets up permissions for roles the first time they are created. This is to prevent conflicts with any permissions changes that happen in the UI after a site is deployed. You can programmatically update roles from code by using the
The main problem comes when you add a new custom entity because if roles have already been generated in the db, no permissions for the custom entity will be added (e.g. read permission for the anonymous role). This can be a little confusing, and also may also go undetected if the developer is logged into the admin panel while developing (super admin has permissions to everything).
Issue #205 was caused by this problem.
There's a number of scenarios we have to consider when designing a solution: