This request is intended to propose a solution to a number of requests surrounding the permission system and the use of the "created_by" value on pages/chapters/shelves/books.
The Scenario
Currently we have various permissions and logic that take into account the creator of an entity. Within the role configuration screen these are shown as "Own" permissions. These use the "created_by" field. There is no way, outside of database access, for this altered between users in the system. When a user is deleted this value is nulled.
Implementation Idea
We would add a concept of "Owners" to the system for entities (Shelves/Books/Chapters/Pages). This would be implemented as follows:
- A 'owned_by' field would be added to each of the entity tables.
- On upgrade, database migrations would copy existing 'created_by' values to the 'owned_by' field.
- Within the "Permissions" menu for an entity, A user that has permission to edit permissions will be able to change the "owner" to a single other individual.
- When deleting a user from the system, the option to select a new owner will be provided, who will become the owner of everything that was previously owned by the deleted user.
Benefits
- By changing the owner an admin could better utilise the "Own" role permissions as they could create a book for users then assign that to a user with "Own" permissions so they can control everything within. As of now, that user would currently also need to be able to create books.
- We may be able to utilise this concept in the future for notifications.
- By not altering the "created_by" field instead and having a separate field, we're keeping the database semantics correct while providing more accurate information to the user.
This request is intended to propose a solution to a number of requests surrounding the permission system and the use of the "created_by" value on pages/chapters/shelves/books.
The Scenario
Currently we have various permissions and logic that take into account the creator of an entity. Within the role configuration screen these are shown as "Own" permissions. These use the "created_by" field. There is no way, outside of database access, for this altered between users in the system. When a user is deleted this value is nulled.
Implementation Idea
We would add a concept of "Owners" to the system for entities (Shelves/Books/Chapters/Pages). This would be implemented as follows:
Benefits