Role-Based Access Control
This page documents the role-based access control (RBAC) system used across SureClinical, and how it governs access to SureDrive features, routes, and operations. It covers the role taxonomy defined in the Java backend, the Angular frontend enforcement layer, and the administration UI for managing roles and features.
Architecture Overview
SureClinical RBAC operates on two parallel role dimensions that are combined per user:
| Dimension | Purpose | Stored In |
|---|---|---|
| System Role | Platform-level authority (Admin, Editor, Viewer, etc.) | user.systemRole on the cached user object |
| User Role | Custom named role configured by admins; mapped to one or more application roles | user.userRole on the cached user object |
A User Role groups one or more Application Roles. Each Application Role belongs to a specific product (Archives/eTMF, CTMS, Network, QMS). Application Roles control which Application Features (individual UI capabilities) a user can access within that product. SureDrive uses the Archives (System / eTMF) application role set.
Role Taxonomy — Java Backend
UserRoleType Enum
File: SC/suredms-common/src/main/java/com/sureclinical/suredms/entity/UserRoleType.java
Defines the six role categories used across the platform:
| Enum Value | Value | Display Name | Role ID Prefix | Application Role? |
|---|---|---|---|---|
TYPE_ROLE | 0 | User Role | suredms_ | No (user-facing role) |
TYPE_ORGANIZATION | 1 | Organization (Legacy) | suredms_ | No (legacy) |
TYPE_SYSTEM | 2 | Archives (System) | suredms_etmf_ | Yes — required |
TYPE_CTMS | 3 | CTMS | suredms_ctms_ | Yes |
TYPE_NETWORK | 4 | Network | suredms_network_ | Yes |
TYPE_QMS | 5 | QMS | suredms_qms_ | Yes |
isApplicationRole() returns true for all types except TYPE_ROLE and TYPE_ORGANIZATION. TYPE_SYSTEM (Archives) is the required application role — it cannot be omitted from a user role definition. canGrantFeatureAccess() returns true for both application roles and the legacy organisation type.
APPLICATION_ROLE_TYPES is a computed constant holding all application role types, used wherever the system needs to iterate over configurable product roles.
SureRoles — Role ID Constants
File: SC/suredms-common/src/main/java/com/sureclinical/suredms/common/SureRoles.java
Central registry of all role ID strings and reserved usernames.
Role ID prefixes:
| Prefix Constant | Value | Application |
|---|---|---|
ROLE_PREFIX | suredms_ | Platform / User Roles |
ETMF_ROLE_PREFIX | suredms_etmf_ | Archives / SureDrive |
CTMS_ROLE_PREFIX | suredms_ctms_ | SureCTMS |
NETWORK_ROLE_PREFIX | suredms_network_ | SureNetwork |
QUALITY_ROLE_PREFIX | suredms_qms_ | SureQMS |
Platform / User Role IDs (prefix suredms_):
| Constant | Role ID | Description |
|---|---|---|
ROLE_SYSTEM_ADMIN | suredms_system_admin | Internal system administrator |
ROLE_SYSTEM_APP | suredms_system_app | Internal system application user |
ROLE_ADMIN | suredms_admin | Platform administrator |
ROLE_USER_MANAGER | suredms_user_manager | User management only |
ROLE_EDITOR | suredms_editor | Content editor |
ROLE_VIEWER | suredms_viewer | Read-only viewer |
ROLE_AUDITOR | suredms_auditor | Audit-only access |
ROLE_SPONSOR | suredms_sponsor | Sponsor (external viewer) |
ROLE_STUDY_ADMINISTRATOR | suredms_study_administrator | Study/drive administrator |
ROLE_PROJECT_EDITOR | suredms_project_editor | Project-scoped editor |
ROLE_FINANCE_EDITOR | suredms_finance_editor | Finance-scoped editor |
ROLE_HUB_USER | suredms_hub_user | External hub user |
ROLE_ETMF_ADMIN | suredms_etmf_admin | Alias for Archives Admin |
Network roles (suredms_network_): viewer, editor, admin, hub_user
QMS roles (suredms_qms_): viewer, auditor, editor, training_manager, documents_manager, admin, department_manager, hub_user
Internal / reserved usernames: Administrator, scsystem, scapp, guest. These accounts are excluded from licence counts and cannot be assigned signing roles.
Internal roles (hidden from admin UI): administrators, suredms_system_admin, suredms_system_app.