Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
200 commits
Select commit Hold shift + click to select a range
c06d7aa
basic ui updates for system users table
apodacaduron Oct 15, 2025
6701ed0
update create users dialog to match figma design
apodacaduron Oct 15, 2025
3df5332
add default to toggle button component
apodacaduron Oct 15, 2025
6491bbd
Tweak message when new user created
apodacaduron Oct 15, 2025
9deb93d
fix typo on save button
apodacaduron Oct 15, 2025
aec0d80
allow users to use main input for search
apodacaduron Oct 16, 2025
e02746d
update edit user dialog
apodacaduron Oct 16, 2025
25b5f14
when selecting user role mark permissions as selected
apodacaduron Oct 16, 2025
6b5be23
allow user to deselect permissions if he has admin role
apodacaduron Oct 16, 2025
b4811c7
view user updates
apodacaduron Oct 17, 2025
e39d98c
basic add of change password dialog
apodacaduron Oct 20, 2025
d933836
improvements to form validations on change password dialog
apodacaduron Oct 20, 2025
3d09347
pass change password evt to dialog and use edited item to check force…
apodacaduron Oct 20, 2025
07b43d4
add saving flag to create user button
apodacaduron Oct 20, 2025
b709d57
add saving flag to change password dialog
apodacaduron Oct 20, 2025
73643d2
tweak 2fa badge on drawer
apodacaduron Oct 20, 2025
24c879f
add force password confirmation to users table
apodacaduron Oct 20, 2025
5d9406f
tweak translation
apodacaduron Oct 20, 2025
ba338aa
add basic filtering ui
apodacaduron Oct 20, 2025
8e85235
copy confirmation dialog from form builder branch
apodacaduron Oct 21, 2025
1fc275f
refactor password reset to use new global confirm dialog
apodacaduron Oct 21, 2025
6a7bf95
add confirmation dialog for global password reset
apodacaduron Oct 21, 2025
0a93b8a
add confirmations dialog to logout user sessions
apodacaduron Oct 21, 2025
fcfaa92
fix card rounded edges
apodacaduron Oct 21, 2025
e5b700a
hide active account switch if user edits it's own account
apodacaduron Oct 21, 2025
3c157b5
reuse existing function
apodacaduron Oct 21, 2025
9ede225
if no role assigned show view only text
apodacaduron Oct 21, 2025
3ca85eb
update revoke2fa to use dialog confirmation
apodacaduron Oct 21, 2025
b0bd0a9
disable toggle button if user is admin
apodacaduron Oct 21, 2025
7039b85
tweak user preview table columns
apodacaduron Oct 21, 2025
ef1f775
adjustment to translations
apodacaduron Oct 21, 2025
70ba7a1
add asterisk to change password page
apodacaduron Oct 21, 2025
bcbc76b
remove root property since users page is already on root
apodacaduron Oct 21, 2025
32a4f50
tweak height of users table
apodacaduron Oct 22, 2025
007dd81
remove .once modifier from logout session and force global password r…
apodacaduron Oct 22, 2025
069399c
remove extra 2fa button
apodacaduron Oct 22, 2025
92a90ab
remove debug logs
apodacaduron Oct 22, 2025
a5c6dd7
add new access roles and allow only selecting one sustem role
apodacaduron Oct 22, 2025
663b943
mark all access roles as checked if user is admin
apodacaduron Oct 22, 2025
15dc255
replace title for name key
apodacaduron Oct 22, 2025
5b31a55
Add filtering support to users API endpoint
level09 Oct 23, 2025
1dc2e35
Change add user button to simply show save changes
apodacaduron Oct 23, 2025
c65d5e5
Merge branch 'main' of https://github.com/sjacorg/bayanat into BYNT-1…
apodacaduron Oct 23, 2025
c10721a
Merge branch 'BYNT-1475-Implement-new-user-dashboard-design' of https…
apodacaduron Oct 23, 2025
f0e6f2d
fix filters on users page so it actually makes a request to backend
apodacaduron Oct 23, 2025
5fccc71
make search clearable and remove useless vars
apodacaduron Oct 23, 2025
f287600
add view only role with id 0
apodacaduron Oct 23, 2025
7e4da19
Enhance users API filtering capabilities
level09 Oct 23, 2025
b4da9bf
Merge branch 'BYNT-1475-Implement-new-user-dashboard-design' of githu…
level09 Oct 23, 2025
0ffcebd
add view only role to filter dropdown and not user create/edit dialog
apodacaduron Oct 23, 2025
a6ae101
fix missing components error
apodacaduron Oct 23, 2025
b1756f4
Mark with a checkmark and primary color selected filters
apodacaduron Oct 24, 2025
36f738b
make user dialog fullscreen and add new access level buttons
apodacaduron Oct 24, 2025
6ad1e5f
if user is admin dont allow to deselect access roles
apodacaduron Oct 24, 2025
3dc4c8f
render access level and role on table and drawer
apodacaduron Oct 24, 2025
e8142e1
access level is now computed on frontend
apodacaduron Oct 27, 2025
39e12ee
tweaks to compute access level on frontend
apodacaduron Oct 27, 2025
a07f5ca
update system role to use btn-toggle, change icon size, and update re…
apodacaduron Oct 27, 2025
56db40b
hide permissions from view only role
apodacaduron Oct 27, 2025
675b2eb
feat: add UserHistory model for tracking user revisions
level09 Nov 5, 2025
ca9880d
add create_revision method to User model for tracking changes
level09 Nov 5, 2025
3b498f3
Register UserHistory model in admin models for user revision tracking
level09 Nov 5, 2025
1717e16
add API endpoint for user history retrieval
level09 Nov 5, 2025
b0c62d3
add API endpoint to temporarily suspend user accounts
level09 Nov 5, 2025
306dfe3
add API endpoint to reactivate suspended user accounts + bug fixes
level09 Nov 5, 2025
2f5039a
add API endpoint to disable user accounts
level09 Nov 5, 2025
3db72e7
add API endpoint to enable user accounts
level09 Nov 5, 2025
daf7eea
Implement sql migration script to efactor system roles in database
level09 Nov 5, 2025
6c9b44a
Refactor role generation in data_helpers.py
level09 Nov 5, 2025
77886d8
Merge branch 'BYNT-1475-Implement-new-user-dashboard-design' of https…
apodacaduron Nov 6, 2025
d696ea8
remove access level logic and add basic user statuses
apodacaduron Nov 6, 2025
0d84bc2
add new translations
apodacaduron Nov 6, 2025
85b729a
tweaks to roles sections and two fa
apodacaduron Nov 6, 2025
fae509d
enforce system role requirement for login
level09 Nov 7, 2025
983eadb
add database migration for system roles refactor
level09 Nov 7, 2025
3423212
update role names in decorators
level09 Nov 7, 2025
97c7a29
update role names in templates
level09 Nov 7, 2025
fdff15f
fix typo
apodacaduron Nov 7, 2025
7a56bca
add missing key to loop and render chip if user has [] permissions
apodacaduron Nov 7, 2025
346c596
move mixin declaration to top
apodacaduron Nov 7, 2025
da09f59
add reusable confirm dialog for account manipulation
apodacaduron Nov 7, 2025
a0ca527
remove payload constant
apodacaduron Nov 7, 2025
c6cacd6
allow disabling accept button from prop
apodacaduron Nov 7, 2025
b560a93
wire up password field and account manipulation requests
apodacaduron Nov 7, 2025
7b86575
initial try to merge both system and access roles into one array
apodacaduron Nov 8, 2025
e7f6325
Merge branch 'roles-permissions-users' of github.com:sjacorg/bayanat …
level09 Nov 8, 2025
4ab7d27
Simplify is_active property to use bool for roles check
level09 Nov 8, 2025
4fb3aea
Update user role names in test fixtures for clarity: changed 'DA' to …
level09 Nov 8, 2025
30a9841
Update role names in test fixture to reflect current terminology: cha…
level09 Nov 8, 2025
a4ce4bf
Add 'deleted' field to User model serialization
level09 Nov 8, 2025
82a2aeb
replace older role names with new ones
apodacaduron Nov 10, 2025
60fa477
Prevent user from deleting view role as it's a default field
apodacaduron Nov 10, 2025
bcec960
if user is disabled hide suspended button
apodacaduron Nov 10, 2025
4b75fdb
change user disabled rule in computed
apodacaduron Nov 10, 2025
011a64b
tweak table and role display, remove deleted field before saving and …
apodacaduron Nov 10, 2025
e78b542
remove default logic to view role
apodacaduron Nov 10, 2025
0811a87
remove useless template
apodacaduron Nov 10, 2025
977f8c7
hide x icon on toggle button when editin an admin user with incomplet…
apodacaduron Nov 10, 2025
99e8c66
add show snack messages
apodacaduron Nov 10, 2025
e4e7490
if user has no permissions, or access role, or system role add a mess…
apodacaduron Nov 10, 2025
7d39208
remove deleted flag from changePassword method
apodacaduron Nov 10, 2025
8340c70
add quick access if user has no roles or permissions
apodacaduron Nov 10, 2025
09b7ed5
fix issue if user has no access roles yet
apodacaduron Nov 10, 2025
c2a2e56
replace password to confirm logic with username instead
apodacaduron Nov 10, 2025
5040b79
expose current user id
apodacaduron Nov 10, 2025
8918e90
hide account manipulation buttons if it's from the currently signed i…
apodacaduron Nov 10, 2025
49b7971
Fix missing and_ import in user filtering logic
level09 Nov 18, 2025
b8cfbdb
Restrict setting active field during user creation only; existing use…
level09 Nov 18, 2025
39af211
Remove active field from allowed attributes in user payload validator
level09 Nov 18, 2025
719027b
remove active flag manipulation
apodacaduron Nov 18, 2025
41e75c7
Set default active status to True for new users during creation, allo…
level09 Nov 18, 2025
0a95c49
Merge branch 'roles-permissions-users' of github.com:sjacorg/bayanat …
level09 Nov 18, 2025
3a8bb1e
Fix user test fixtures to properly handle foreign key dependencies
level09 Nov 19, 2025
ffb7ba1
Add proper cleanup of user dependencies in users fixture
level09 Nov 19, 2025
91d2d82
Remove active field from user test payload to match validation model
level09 Nov 19, 2025
8d17af6
Add UserStatus enum to define user account statuses
level09 Nov 27, 2025
5bdd9bc
Implement user account status field and update is_active logic to ref…
level09 Nov 27, 2025
5d21a23
Add set_status method to manage user status with validation and side …
level09 Nov 27, 2025
f012913
Update user model to replace active and deleted fields with a unified…
level09 Nov 27, 2025
442575a
Refactor user model to set status during creation, replacing active f…
level09 Nov 27, 2025
e8b86f3
Update user suspension logic to utilize UserStatus enum, ensuring pro…
level09 Nov 27, 2025
713643a
Refine user reactivation and suspension error handling to improve cla…
level09 Nov 27, 2025
094c463
Refactor user disable logic to utilize UserStatus enum, replacing dir…
level09 Nov 27, 2025
9e12bf1
Enhance user reactivation process by clarifying status changes; now s…
level09 Nov 27, 2025
6d7530d
Add unified endpoint for setting user status; includes validation and…
level09 Nov 27, 2025
fdc100b
Add migration to introduce user status field, replacing active boolea…
level09 Nov 27, 2025
57fb9c0
Update api_users endpoint to replace 'active' filter with 'status' fi…
level09 Nov 27, 2025
75269f6
update users page to use status key instead of the old active / deleted
apodacaduron Nov 28, 2025
c289394
fix username not being cleared on reject
apodacaduron Nov 28, 2025
ce651bd
update key to be active
apodacaduron Nov 28, 2025
3937814
update last remains of the old deleted flag
apodacaduron Nov 28, 2025
165f4ef
Merge branch 'roles-permissions-users' of github.com:sjacorg/bayanat …
level09 Dec 1, 2025
3f8af45
Merge branch 'main' of https://github.com/sjacorg/bayanat into roles-…
apodacaduron Dec 1, 2025
be00a37
add missing semi colons reported by gh ai
apodacaduron Dec 1, 2025
1a70772
add dialog missing translations
apodacaduron Dec 1, 2025
285fd0e
add more translations
apodacaduron Dec 1, 2025
d6ba67f
Remove role-stripping on user disable
level09 Dec 1, 2025
12bf6af
Update user status logic to default to SUSPENDED for users without roles
level09 Dec 1, 2025
7cdfd60
Merge branch 'roles-permissions-users' of github.com:sjacorg/bayanat …
level09 Dec 1, 2025
cc1c4a7
Update enable endpoint to activate users with roles directly
level09 Dec 1, 2025
7aea658
Simplified the unified /status endpoint, removed the forced DISABLED …
level09 Dec 1, 2025
c9c4b1a
if user has no roles and is suspended disable button and add tooltip …
apodacaduron Dec 2, 2025
556b5fe
if password reset was requested still allow to change password just h…
apodacaduron Dec 2, 2025
78f3dcd
Parse number to boolean on disabled prop
apodacaduron Dec 2, 2025
453cb5d
tweak index selection
apodacaduron Dec 2, 2025
873ef27
move actionSections from data to computed
apodacaduron Dec 2, 2025
9c91eaf
make toggle button more readable
apodacaduron Dec 2, 2025
a8f2242
get rid of timeout on cleanup and use v-dialog afterLeave event
apodacaduron Dec 2, 2025
af4e6b1
remove cleanup function since now it's automatically run on afterLeave
apodacaduron Dec 2, 2025
22dd452
add null safe operators when confirm dialog is cleaned up
apodacaduron Dec 2, 2025
aff1dea
remove redundant check and rename variable
apodacaduron Dec 3, 2025
89de59f
Updated user history API endpoint to require "Admin" role
level09 Dec 4, 2025
4713cd2
Merge branch 'roles-permissions-users' of github.com:sjacorg/bayanat …
level09 Dec 4, 2025
af45198
Add password confirmation to reactivate and enable endpoints
level09 Dec 4, 2025
3819f77
Simplify UserHistory model for admin-only access
level09 Dec 4, 2025
72c560b
Remove auto-assignment of View role in migration
level09 Dec 4, 2025
b4a04f3
on reactivate or enable send password to confirm
apodacaduron Dec 4, 2025
b9041e0
Add Moderator role to all Analyst endpoints
level09 Dec 5, 2025
bf03d70
Update tests for Moderator access to Analyst endpoints
level09 Dec 5, 2025
f1ddf28
Merge branch 'roles-permissions-users' of github.com:sjacorg/bayanat …
level09 Dec 5, 2025
67b9faa
Improve roles descriptions
tarekio Dec 5, 2025
b7f30f0
make system role required by default
apodacaduron Dec 5, 2025
30b039c
tweak validation to allow selecting 0 values
apodacaduron Dec 5, 2025
60f903a
rename data analyst to analyst
apodacaduron Dec 5, 2025
93f5dc0
improve logic of system role selection, becoming an admin selects all…
apodacaduron Dec 5, 2025
255f960
fix errors when selecting admin
apodacaduron Dec 5, 2025
6dbc883
fix empty roles array
apodacaduron Dec 5, 2025
dc9b37d
add label to access role on admin selection, bring back previous sele…
apodacaduron Dec 5, 2025
7d8dcbb
add new translation
apodacaduron Dec 11, 2025
82e5d4a
add history button with tooltip on toolbar and emit showHistory evt
apodacaduron Dec 11, 2025
9a384af
call open history function to display drawer
apodacaduron Dec 11, 2025
2c83a50
revision history drawer on users page
apodacaduron Dec 11, 2025
652cd34
map history so it looks better on diff
apodacaduron Dec 11, 2025
d4ae136
Add /api/users/assignable/ endpoint for task assignment
level09 Dec 15, 2025
1d6ed3c
Update roles decorator for /api/users/ endpoint to require "Admin" ro…
level09 Dec 15, 2025
87e7171
Update user endpoint tests for role-based access changes
level09 Dec 15, 2025
d14ddbf
Merge branch 'roles-permissions-users' of github.com:sjacorg/bayanat …
level09 Dec 15, 2025
43954c5
update /users endpoint for /assignable so moderators can keep loading…
apodacaduron Dec 16, 2025
a9f2ce4
parse user agent to display in sessions table device and browser
apodacaduron Jan 6, 2026
cad17a0
add round toggle button to user card
apodacaduron Jan 6, 2026
3f43dda
fix if statement to allow showing no changes text on first revision item
apodacaduron Jan 6, 2026
c2c9c48
Fix Activity.create() call and type signature in forms.py
level09 Jan 6, 2026
191cb32
Merge branch 'roles-permissions-users' of github.com:sjacorg/bayanat …
level09 Jan 6, 2026
03b9a24
Add revision history for user status changes
level09 Jan 6, 2026
9e30819
Add activity logging for admin force password reset
level09 Jan 6, 2026
f9e5453
add show password button to change_password.html
apodacaduron Jan 7, 2026
dc58751
when globally forcing password reload page to show the change passwor…
apodacaduron Jan 7, 2026
fc91078
refresh users list if account status is changed suspend or disable
apodacaduron Jan 7, 2026
43a74b5
Merge branch 'main' of https://github.com/sjacorg/bayanat into roles-…
apodacaduron Jan 26, 2026
f7d4530
remove display name from update user payload
apodacaduron Jan 27, 2026
3caa3b2
Merge remote-tracking branch 'origin/main' into roles-permissions-users
level09 Jan 27, 2026
8364199
Merge branch 'main' of https://github.com/sjacorg/bayanat into roles-…
apodacaduron Jan 28, 2026
f90d6a9
Merge branch 'main' of https://github.com/sjacorg/bayanat into roles-…
apodacaduron Jan 28, 2026
400387e
Merge branch 'main' into roles-permissions-users
level09 Jan 29, 2026
38a0431
Fix user status management and use set_status() consistently
level09 Jan 29, 2026
8626dbe
replace assigned_to.active with assigned_to.status since active is no…
apodacaduron Jan 29, 2026
80ad67c
Merge branch 'roles-permissions-users' of https://github.com/sjacorg/…
apodacaduron Jan 29, 2026
a05710d
Use to_compact() for assigned_to and first_peer_reviewer in list views
level09 Jan 29, 2026
faec9cd
Merge branch 'main' into roles-permissions-users
level09 Jan 29, 2026
9127275
Fix create_inactive_user fixture to set status field
level09 Jan 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions enferno/admin/models/Activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,21 @@ def to_dict(self) -> dict[str, Any]:
# helper static method to create different type of activities (tags)
@staticmethod
def create(
user: t.id,
user: "User",
action: str,
status: str,
subject: str,
subject: dict,
model: str,
details: Optional[str] = None,
) -> None:
"""
Create an activity.

Args:
- user: the user id.
- user: the user object.
- action: the action.
- status: the status.
- subject: the subject.
- subject: the subject dict (e.g. from to_mini()).
- model: the model.
- details: the details.
"""
Expand Down
46 changes: 46 additions & 0 deletions enferno/admin/models/UserHistory.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import json
from typing import Any

from sqlalchemy import JSON

from enferno.extensions import db
from enferno.utils.base import BaseMixin
from enferno.utils.date_helper import DateHelper
from enferno.utils.logging_utils import get_logger

logger = get_logger()


class UserHistory(db.Model, BaseMixin):
"""
SQL Alchemy model for user revisions.
Access is restricted to Admin role at the endpoint level.
"""

id = db.Column(db.Integer, primary_key=True)
target_user_id = db.Column(db.Integer, db.ForeignKey("user.id"), index=True)
target_user = db.relationship(
"User",
backref=db.backref("history", order_by="UserHistory.updated_at"),
foreign_keys=[target_user_id],
)
data = db.Column(JSON)
# user tracking - who made the change
user_id = db.Column(db.Integer, db.ForeignKey("user.id"))
user = db.relationship("User", foreign_keys=[user_id])

def to_dict(self) -> dict[str, Any]:
"""Return a dictionary representation of the user revision."""
return {
"id": self.id,
"data": self.data,
"created_at": DateHelper.serialize_datetime(self.created_at),
"user": self.user.to_compact() if self.user else None,
}

def to_json(self) -> str:
"""Return a JSON representation of the user revision."""
return json.dumps(self.to_dict(), sort_keys=True)

def __repr__(self):
return "<UserHistory {} -- Target {}>".format(self.id, self.target_user_id)
1 change: 1 addition & 0 deletions enferno/admin/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@
from .Source import Source
from .WorkflowStatus import WorkflowStatus
from .Notification import Notification
from .UserHistory import UserHistory
12 changes: 6 additions & 6 deletions enferno/admin/templates/admin/actors.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@


<v-spacer></v-spacer>
{% if current_user.roles_in(['Admin','DA']) %}
{% if current_user.roles_in(['Admin','Analyst']) %}
<v-btn @click="editItem" color="primary" variant="elevated"
class="ma-2">{{ _('New Actor') }}</v-btn>
{% endif %}
Expand Down Expand Up @@ -568,7 +568,7 @@
{title: "{{_('ID')}}", value: "id", width: 12, sortable: false},
{title: "{{_('Type')}}", value: "type", width: 20, sortable: false},
{title: "{{_('Name')}}", value: "name", width: 300, sortable: false},
{% if (current_user.has_role('Admin') or current_user.has_role('DA')) %}
{% if (current_user.has_role('Admin') or current_user.has_role('Analyst')) %}
Comment thread
github-code-quality[bot] marked this conversation as resolved.
Fixed
{title: "{{_('Assigned To')}}", value: "assigned_to.name", width: 130, sortable: false},
{title: "{{_('Access Groups')}}", value: "roles", width: 130, sortable: false},
{% endif %}
Expand Down Expand Up @@ -1298,7 +1298,7 @@
searchUsers: debounce(function (evt) {
this.searchLoading[evt.target.dataset.loader] = true;

api.get(`/admin/api/users/?q=${evt.target.value}`).then(response => {
api.get(`/admin/api/users/assignable?q=${evt.target.value}`).then(response => {
this.users = response.data.items;
this.searchLoading[evt.target.dataset.loader] = false;
});
Expand Down Expand Up @@ -1347,7 +1347,7 @@
},

bulkAllowed() {
return this.has_role(this.currentUser, 'Admin') || this.has_role(this.currentUser, 'Mod');
return this.has_role(this.currentUser, 'Admin') || this.has_role(this.currentUser, 'Moderator');
},

exportAllowed() {
Expand All @@ -1371,7 +1371,7 @@
if (this.has_role(this.currentUser, 'Admin')) {
return true;
}
if (!this.has_role(this.currentUser, 'DA')) {
if (!this.has_role(this.currentUser, 'Analyst')) {
return false;
}
const statuses = ['Human Created', 'Assigned', 'Updated', 'Peer Reviewed', 'Revisited'];
Expand Down Expand Up @@ -1405,7 +1405,7 @@
}

if (this.currentUser.can_self_assign) {
if ((!actor.assigned_to) || (actor.assigned_to && !actor.assigned_to.active)) {
if ((!actor.assigned_to) || (actor.assigned_to && actor.assigned_to.status !== 'active')) {
return true
}

Expand Down
10 changes: 5 additions & 5 deletions enferno/admin/templates/admin/bulletins.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
></v-text-field>

<v-spacer></v-spacer>
{% if current_user.roles_in(['Admin','DA']) %}
{% if current_user.roles_in(['Admin','Analyst']) %}
<v-btn
@click="editItem"
color="primary"
Expand Down Expand Up @@ -643,7 +643,7 @@
{title: "{{_('ID')}}", value: "id", width: 12, sortable: true},
{title: "{{_('Title')}}", value: "title", width: 300, sortable: false},

{% if (current_user.has_role('Admin') or current_user.has_role('DA')) %}
{% if (current_user.has_role('Admin') or current_user.has_role('Analyst')) %}
Comment thread
github-code-quality[bot] marked this conversation as resolved.
Fixed
{title: "{{_('Assigned To')}}", value: "assigned_to.name", width: 130, sortable: false},
{title: "{{_('Access Groups')}}", value: "roles", width: 130, sortable: false},
{% endif %}
Expand Down Expand Up @@ -1378,7 +1378,7 @@
if (this.has_role(this.currentUser, 'Admin')) {
return true;
}
if (this.has_role(this.currentUser, 'Mod')) {
if (this.has_role(this.currentUser, 'Moderator')) {
return true;
}
return false;
Expand All @@ -1405,7 +1405,7 @@
if (this.has_role(this.currentUser, 'Admin')) {
return true;
}
if (!this.has_role(this.currentUser, 'DA')) {
if (!this.has_role(this.currentUser, 'Analyst')) {
return false;
}
const statuses = ['Human Created', 'Assigned', 'Updated', 'Peer Reviewed', 'Revisited'];
Expand Down Expand Up @@ -1439,7 +1439,7 @@
}

if (this.currentUser.can_self_assign) {
if ((!bulletin.assigned_to) || (bulletin.assigned_to && !bulletin.assigned_to.active)) {
if ((!bulletin.assigned_to) || (bulletin.assigned_to && bulletin.assigned_to.status !== 'active')) {
return true
}

Expand Down
2 changes: 1 addition & 1 deletion enferno/admin/templates/admin/eventtypes.html
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
{title: "{{_('For Actors')}}", value: "for_actor"},
{title: "{{_('For Bulletins')}}", value: "for_bulletin"},
{title: "{{_('Comments')}}", value: "comments"},
{% if current_user.roles_in(['Admin','Mod']) %}
{% if current_user.roles_in(['Admin','Moderator']) %}
Comment thread
github-code-quality[bot] marked this conversation as resolved.
Fixed
{title: "{{_('Actions')}}", value: "action", sortable: false}
{% endif %}
],
Expand Down
12 changes: 6 additions & 6 deletions enferno/admin/templates/admin/incidents.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@


<v-spacer></v-spacer>
{% if current_user.roles_in(['Admin','DA']) %}
{% if current_user.roles_in(['Admin','Analyst']) %}
<v-btn @click="editItem" color="primary" variant="elevated" class="ma-2"
>{{ _('New Incident') }}</v-btn
>
Expand Down Expand Up @@ -535,7 +535,7 @@
headers: [
{title: "{{_('ID')}}", value: "id", width: 12, sortable: false},
{title: "{{_('Title')}}", value: "title", width: 300, sortable: false},
{% if (current_user.has_role('Admin') or current_user.has_role('DA')) %}
{% if (current_user.has_role('Admin') or current_user.has_role('Analyst')) %}
Comment thread
github-code-quality[bot] marked this conversation as resolved.
Fixed
{title: "{{_('Assigned To')}}", value: "assigned_to.name", width: 130, sortable: false},
{title: "{{_('Access Groups')}}", value: "roles", width: 130, sortable: false},
{% endif %}
Expand Down Expand Up @@ -1122,7 +1122,7 @@
searchUsers: debounce(function (evt) {
this.searchLoading[evt.target.dataset.loader] = true;

api.get(`/admin/api/users/?q=${evt.target.value}`).then(response => {
api.get(`/admin/api/users/assignable?q=${evt.target.value}`).then(response => {
this.users = response.data.items;
this.searchLoading[evt.target.dataset.loader] = false;
});
Expand Down Expand Up @@ -1175,7 +1175,7 @@
if (this.has_role(this.currentUser, 'Admin')) {
return true;
}
if (this.has_role(this.currentUser, 'Mod')) {
if (this.has_role(this.currentUser, 'Moderator')) {
return true;
}
return false;
Expand All @@ -1200,7 +1200,7 @@
if (this.has_role(this.currentUser, 'Admin')) {
return true;
}
if (!this.has_role(this.currentUser, 'DA')) {
if (!this.has_role(this.currentUser, 'Analyst')) {
return false;
}
const statuses = ['Human Created', 'Assigned', 'Updated', 'Peer Reviewed', 'Revisited'];
Expand Down Expand Up @@ -1236,7 +1236,7 @@


if (this.currentUser.can_self_assign) {
if ((!incident.assigned_to) || (incident.assigned_to && !incident.assigned_to.active)) {
if ((!incident.assigned_to) || (incident.assigned_to && incident.assigned_to.status !== 'active')) {
return true
}

Expand Down
71 changes: 67 additions & 4 deletions enferno/admin/templates/admin/jsapi.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,34 @@ allUnsavedEditsHaveBeenDiscarded_: "{{ _('All unsaved edits in the form have bee
reviewAndConfirmChanges_: "{{ _('Review & Confirm Changes') }}",
youreAboutToDeleteAField_: "{{ _('You\'re about to delete a field') }}",
fieldsSavedSuccessfully_: "{{ _('Fields saved successfully') }}",
editUser_: "{{ _('Edit User') }}",
systemRole_: "{{ _('System Role') }}",
accessRole_: "{{ _('Access Role') }}",
manageAccount_: "{{ _('Manage Account') }}",
disabled_: "{{ _('Disabled') }}",
twoFactorAuthentication_: "{{ _('Two-Factor Authentication') }}",
youreAboutToEndThisSession_: "{{ _('You\'re about to end this session') }}",
afterThisActionTheUserWillBeSignedOut_: "{{ _('After this action, the user will be signed out from this device. This will not affect other active sessions, user data, or settings.') }}",
doYouWantToContinue_: "{{ _('Do you want to continue?') }}",
endSession_: "{{ _('End Session') }}",
view_: "{{ _('View') }}",
reactivateAccount_: "{{ _('Reactivate Account') }}",
suspendAccount_: "{{ _('Suspend Account') }}",
enableAccount_: "{{ _('Enable Account') }}",
disableAccount_: "{{ _('Disable Account') }}",
assignSystemRole_: "{{ _('Assign System Role') }}",
assignAccessRole_: "{{ _('Assign Access Role') }}",
assignUserPermissions_: "{{ _('Assign User Permissions') }}",
userHasBeenSuspended_: (name) => "{{ _('User \'{name}\' has been suspended.') }}".replace("{name}", name),
userHasBeenDisabled_: (name) => "{{ _('User \'{name}\' has been disabled.') }}".replace("{name}", name),
userHasBeenReactivated_: (name) => "{{ _('User \'{name}\' has been reactivated.') }}".replace("{name}", name),
userHasBeenEnabled_: (name) => "{{ _('User \'{name}\' has been enabled.') }}".replace("{name}", name),
revisionHistory_: "{{ _('Revision History') }}",
desktop_: "{{ _('Desktop') }}",
tablet_: "{{ _('Tablet') }}",
mobile_: "{{ _('Mobile') }}",
unknownBrowser_: "{{ _('Unknown Browser') }}",
unknownOS_: "{{ _('Unknown OS') }}",

cancel_ : "{{ _('Cancel') }}",
titleOrTitleArRequired_ : "{{ _('Title or Title (Ar) is required') }}",
Expand Down Expand Up @@ -286,6 +314,37 @@ actorType_ : "{{ _('Actor Type') }}",
relationshipWithBulletin_: (id) => "{{ _('Relationship with Bulletin {id}') }}".replace("{id}", id),
relationshipBetweenActorAndBulletinWillBeCreated_ : "{{ _('The relationship between the new Actor and the Bulletin will be created when the Actor is saved') }}",

youAreAboutToSuspendTheAccountForUser_: (name) => "{{ _('You\'re about to suspend the account for user \'{name}\'') }}".replace('{name}', name),
byEnteringUsernameYouConfirmSuspendForUser_: (name) => "{{ _('By entering the user\'s username, you will confirm the suspend action for user \'{name}\'') }}".replace('{name}', name),
youAreAboutToReactivateUser_: (name) => "{{ _('You\'re about to reactivate user \'{name}\'') }}".replace('{name}', name),
byEnteringYourPasswordYouConfirmReactivationForUser_: (name) => "{{ _('By entering your password, you will confirm the reactivation for user \'{name}\'') }}".replace('{name}', name),
youAreAboutToDisableTheAccountForUser_: (name) => "{{ _('You\'re about to disable the account for user \'{name}\'') }}".replace('{name}', name),
byEnteringUsernameYouConfirmDisableForUser_: (name) => "{{ _('By entering the user\'s username, you will confirm the disable action for user \'{name}\'') }}".replace('{name}', name),
youAreAboutToEnableTheAccountForUser_: (name) => "{{ _('You\'re about to enable the account for user \'{name}\'') }}".replace('{name}', name),
byEnteringYourPasswordYouConfirmEnablingTheAccountForUser_: (name) => "{{ _('By entering your password, you will confirm enabling the account for user \'{name}\'') }}".replace('{name}', name),
intendedFor_: "{{ _('Intended for') }}",
rolesAndAccessRemoval_: "{{ _('Roles and Access Removal') }}",
rolesAndAccessRestoration_: "{{ _('Roles and Access Restoration') }}",
accessRemoval_: "{{ _('Access Removal') }}",
accessRestoration_: "{{ _('Access Restoration') }}",
profileAndContributions_: "{{ _('Profile and Contributions') }}",
temporarySuspensionsInternalInvestigationsOrOnLeave_: "{{ _('Temporary suspensions, such as during internal investigations or when the user is on leave.') }}",
userCanNoLongerLoginToBayanat_: "{{ _('The user will no longer be able to log in to Bayanat.') }}",
rolesAccessAndAssignmentsRemainUnchanged_: "{{ _('Their system roles, access permissions, and assigned items will remain unchanged.') }}",
permanentlyEndingUserAccessToBayanat_: "{{ _('Permanently ending a user\'s access to Bayanat, such as when they leave the organization.') }}",
userProfileRetainedForArchivalPurposes_: "{{ _('The user\'s profile will be retained for archival purposes.') }}",
itemsCreatedOrUpdatedByUserWillRemainInBayanat_: "{{ _('Items created or updated by the user will remain in Bayanat.') }}",
activityHistoryWillContinueToReflectUserContributions_: "{{ _('Activity history will continue to reflect the user\'s contributions.') }}",
previousRolesAndAccessPermissionsWillBeRestored_: "{{ _('Previous system roles and access permissions will be restored.') }}",
userCanLoginAndPerformRoleActions_: "{{ _('User can log in to Bayanat and perform actions allowed by their roles.') }}",
userCanUseExistingPasswordToAccessBayanat_: "{{ _('User can use their existing password to access Bayanat.') }}",
previousProfileAndContributionsRemainIntact_: "{{ _('The user\'s previous profile and contributions remain intact.') }}",
theUserWillBeAbleToViewAndEditItemsTheyPreviouslyHadAccessTo_: "{{ _('The user will be able to view and edit items they previously had access to.') }}",
whatYouShouldKnow_: "{{ _('What you should know') }}",
enterUsernameToConfirm_: "{{ _('Enter username to confirm') }}",
confirmWithYourPassword_: "{{ _('Confirm with your password') }}",
pleaseAssignASystemRoleToReactivateUser_: "{{ _('Please assign a system role to reactivate user') }}",

originPlace_ : "{{ _('Place of Origin') }}",

idNumber_ : "{{ _('ID Number') }}",
Expand Down Expand Up @@ -422,7 +481,6 @@ noLogs: "{{ _('No log files available') }}",
URGENT_: "{{ _('URGENT') }}",
noNotificationsYet_: "{{ _('No notifications yet') }}",
noNotificationsYetDescription_: "{{ _("You haven't received any notifications yet. When you do, they'll appear here.") }}",
loadMore_: "{{ _('Load more') }}",
noMoreNotificationsToLoad_: "{{ _('No more notifications to load.') }}",
notificationsCouldNotBeLoaded_: "{{ _('Oops! Notifications couldn’t be loaded') }}",
weAreHavingTroubleFetchingNotifications_: "{{ _('We’re having trouble fetching your notifications right now. Check your connection or refresh the page.') }}",
Expand Down Expand Up @@ -468,7 +526,7 @@ loggedOut_: "{{ _('You have been logged out. Please log in again.') }}",
confirmLogout_: "{{ _('Are you sure you want to log out all sessions for this user?') }}",
userPermissions_: "{{ _('User Permissions') }}",
userTwoFactorMethods_: "{{ _('User 2FA Methods') }}",
noTwoFactorMethods_: "{{ _('2FA Inactive') }}",
twoFaInactive_: "{{ _('2FA Inactive') }}",
canViewUsernames_: "{{ _('Can View Usernames') }}",
cannotViewUsernames_: "{{ _('Cannot View Usernames') }}",
canViewSimpleHistory_: "{{ _('Can View Simple History') }}",
Expand All @@ -483,6 +541,8 @@ canSelfAssign_: "{{ _('Can Self Assign') }}",
cannotSelfAssign_: "{{ _('Cannot Self Assign') }}",
userSessions_: "{{ _('User Sessions') }}",
session_: "{{ _('Session') }}",
browser_: "{{ _('Browser') }}",
device_: "{{ _('Device') }}",
ip_: "{{ _('IP') }}",
userAgent_: "{{ _('User Agent') }}",
started_: "{{ _('Started') }}",
Expand Down Expand Up @@ -615,12 +675,15 @@ started_: "{{ _('Started') }}",
logOffThisDevice_: "{{ _('Log off this device') }}",
active_: "{{ _('Active') }}",
inactive_: "{{ _('Inactive') }}",
logoutAllSessions_: "{{ _('Logout All Sessions') }}",
logoutAll_: "{{ _('Logout All') }}",
resetPassword_: "{{ _('Reset password') }}",
passwordResetAlreadyRequested_: "{{ _('Password reset already requested.') }}",
passwordResetRequested_: "{{ _('Password reset requested.') }}",
passwordResetRequested_: "{{ _('Password Reset Requested.') }}",
forcePasswordReset_: "{{ _('Force password reset') }}",
revoke2fa_: "{{ _('Revoke 2FA') }}",
changePassword_: "{{ _('Change Password') }}",
changePasswordForUser_: (name) => "{{ _('Change Password for user “{name}”') }}".replace("{name}", name),
youreAboutToForceAPasswordResetForUser_: (name) => "{{ _('You’re about to force a password reset for user “{name}”') }}".replace("{name}", name),

// validations
mustBeMaxCharactersOrFewer_: (max) => "{{ _('Must be {max} characters or fewer.') }}".replace("{max}", max),
Expand Down
Loading
Loading