diff --git a/enferno/admin/templates/admin/users.html b/enferno/admin/templates/admin/users.html index 6029d656c..f585fc0ca 100644 --- a/enferno/admin/templates/admin/users.html +++ b/enferno/admin/templates/admin/users.html @@ -131,7 +131,7 @@ - + @@ -141,12 +141,16 @@ - - + + + + + {{ _('User Details') }} - + + - - - - - - - + + + + + - + - - - - - - - - - - + + + + + + - - - - - - - - - - + + + + + + - + + > + + + + + ${ item.raw.name } + mdi-check + + + ${ item.raw.description } + + + + + + - - + + + {{ _('Account Status') }} + + + + + {{ _('Active') }} + + - - - + + {{ _('User Permissions') }} + + + + + {{ _('Can View Usernames') }} + + - - + + + + {{ _('Can View Activity Overview') }} + + - - + + + + {{ _('Can View Detailed Activity Record') }} + + - - + + + + {{ _('Can Self-Assign') }} + + - - + + + + {{ _('Can Edit Locations') }} + + - - + + + + {{ _('Can Request Exports') }} + + - - + + + + {{ _('Can Import From Web') }} + + - - + + + + {{ _('Can Access Media') }} + + - - + + + {{ _('Revoke 2FA') }} - - mdi-logout + {{ _('Logout All Sessions') }} - {{ _('Close') }} - - {{ _('Save') }} + {{ _('Cancel') }} + + ${ saveButtonText } @@ -388,7 +425,10 @@ computed: { formTitle() { - return this.editedItem?.id ? "{{_('Edit Item')}}" : "{{_('New Item')}}"; + return this.editedItem?.id ? "{{_('Edit User')}}" : "{{_('Add New User')}}"; + }, + saveButtonText() { + return this.editedItem?.id ? "{{_('Save')}}" : "{{_('Add User')}}"; }, }, diff --git a/enferno/static/css/app.css b/enferno/static/css/app.css index 4db89966f..70087ff7b 100644 --- a/enferno/static/css/app.css +++ b/enferno/static/css/app.css @@ -1004,3 +1004,7 @@ div.jsondiffpatch-child-node-type-array:after { margin-top: 1em; margin-bottom: 1em; } + +.v-input--disabled .field-action-enabled { + pointer-events: auto; +} diff --git a/enferno/utils/data_helpers.py b/enferno/utils/data_helpers.py index 4a4ab317e..900faa007 100644 --- a/enferno/utils/data_helpers.py +++ b/enferno/utils/data_helpers.py @@ -91,7 +91,10 @@ def generate_user_roles() -> None: if not r: role = Role() role.name = "Admin" - role.description = "System Role" + role.description = ( + "Full access to all items and actions, including Activity Monitor and user " + "management across the system." + ) role.save() # create DA role, if not exists @@ -99,7 +102,10 @@ def generate_user_roles() -> None: if not r: role = Role() role.name = "DA" - role.description = "System Role" + role.description = ( + "User can view all items and edit only those assigned to them. User can " + "review assigned items for peer review." + ) role.save() # create MOD role, if not exists @@ -107,7 +113,7 @@ def generate_user_roles() -> None: if not r: role = Role() role.name = "Mod" - role.description = "System Role" + role.description = "User can manage system data, edit assigned items, and perform bulk updates." role.save() diff --git a/migrations/versions/479c8b98b036_update_default_role_descriptions.py b/migrations/versions/479c8b98b036_update_default_role_descriptions.py new file mode 100644 index 000000000..3e4432a43 --- /dev/null +++ b/migrations/versions/479c8b98b036_update_default_role_descriptions.py @@ -0,0 +1,57 @@ +"""update default role descriptions + +Revision ID: 479c8b98b036 +Revises: 68396035f041 +Create Date: 2026-07-06 11:06:11.207531 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '479c8b98b036' +down_revision = '68396035f041' +branch_labels = None +depends_on = None + + +role_table = sa.table( + "role", + sa.column("name", sa.String), + sa.column("description", sa.String), +) + +NEW_DESCRIPTIONS = { + "Admin": ( + "Full access to all items and actions, including Activity Monitor and user " + "management across the system." + ), + "DA": ( + "User can view all items and edit only those assigned to them. User can " + "review assigned items for peer review." + ), + "Mod": "User can manage system data, edit assigned items, and perform bulk updates.", +} + +OLD_DESCRIPTION = "System Role" + + +def upgrade(): + for name, description in NEW_DESCRIPTIONS.items(): + op.execute( + role_table.update() + .where(role_table.c.name == name) + .where(role_table.c.description == OLD_DESCRIPTION) + .values(description=description) + ) + + +def downgrade(): + for name, description in NEW_DESCRIPTIONS.items(): + op.execute( + role_table.update() + .where(role_table.c.name == name) + .where(role_table.c.description == description) + .values(description=OLD_DESCRIPTION) + )