summaryrefslogtreecommitdiffstats
path: root/ogcp/templates/auth/add_user.html
Commit message (Collapse)AuthorAgeFilesLines
* ogcp: add user permission mechanismAlejandro Sirgo Rica2024-06-271-51/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new user permission system to control the allowed operations accessible from each account. Add a permission matrix editable through the user/add and user/edit views. The permission matrix has client, center, room, folder, image and repository as permission targets and add, update and delete as permission types. Restrict each view based on the user permissions, hide all actions from not autheticated users. permissions defined in the class UserForm. Serialize each user permissions into ogcp.json as: { ... "USERS" [ { "USER": "admin" ... "PERMISSIONS": { "CLIENT": { "ADD": true, "UPDATE": true, "DELETE": true, }, ... <- same structure for "CENTER", "ROOM", "FOLDER", "IMAGE" and "REPOSITORY" } }, ... ], ... } Grant all the permissions to old user configuration to not disrupt their workflow. The administrator will need to assign the permissions for each user. Ignore scope and permission restrictions for admin users. Save permissions and scopes even if the user is admin to account for the case of a temporal admin promotion without losing the previous configuration. Use template inheritance for add_user.html and edit_user.html to prevent big code duplication with the new HTML code to render the permission matrix. Make user administration an admin only feature. Define methods get_permission and target_is_disabled to improve readability in template conditionals that disable features based on user permissions.
* forms: use checkboxes for scope selection in UserFormAlejandro Sirgo Rica2024-06-141-4/+40
| | | | | | | Enable selection of multiple scopes in user/add and user/edit for restricted users. Replace quick form creation with an inline form definition in add_user.html and edit_user.html
* Move password hashing to the backendJavier Sánchez Parra2022-06-301-10/+1
| | | | | | | | | | | This patch moves login password hashing from the frontend/javascript to the backend/flask. This patch moves password hashing of login and user management forms. Related commits: * c7b0024 ("Add password hashing") * 661254b ("Add 'Add user' to Users section")
* Add 'Add user' to Users sectionJavier Sánchez Parra2022-04-271-0/+26
Creates "Add user" form with the following inputs: username, password, password confirmation, role (administrator or regular), allowed scopes.