You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Enable JSR-250 annotations in SecurityConfig
JSR-250 annotations (like @RolesAllowed) are now enabled in the SecurityConfig by setting `jsr250Enabled` to true. This enhances the flexibility of role-based access control within the application.
* Refactor role-based authority handling in CustomUserDetails
Updated the constructor to properly map user roles and dynamically add top admin privileges when applicable. Introduced new imports for improved role management and logging for debugging purposes. These changes enhance clarity and ensure more robust role-based access control.
* Add UUID initialization for Role and Privilege
Prevents test failing when using logging statements. The toString requires a uuid.
* Prevent security context setup after error responses
Added early return statements in JWTFilter to ensure the security context is not set up after sending error responses for unauthorized or forbidden access. This change avoids potential security issues and ensures proper request handling.
* Force eager loading of Privilege.accessRules to avoid LazyInitializationException
After switching granted authorities from privileges to roles, privilege.accessRules are no longer loaded into the Hibernate session when building CustomUserDetails. This change forces the fetch type to EAGER so that accessRules are preloaded with each Privilege entity and prevents LazyInitializationException. This will likely have negative consequences in our BioDataCatalyst environment and require a technical debt ticket to revert to lazy loading.
* Replace @secured with @RolesAllowed annotations for authorization
* Refactor role handling and remove default "ROLE_" prefix.
Updated `CustomUserDetails` to use privileges instead of roles and removed redundant logic for adding admin roles. Added `GrantedAuthorityDefaults` bean in `SecurityConfig` to eliminate the default "ROLE_" prefix for better alignment with custom authorities.
* Refactor role naming to use centralized AuthNaming constants
Removed the SecurityRoles enum and replaced its usage with centralized constants from AuthNaming.AuthRoleNaming.
* Revert EAGER fetch
* Remove SecurityRoles import across test files
File has been deleted
* Remove "ROLE_" prefix from role names and update usage
Changed role constants to remove the "ROLE_" prefix and updated the role naming convention. Added a GrantedAuthorityDefaults bean in SecurityConfig to ensure role-based security annotations match the updated role names.
* Update AuthRoleNaming documentation and remove unused constant
Refined the JavaDoc for AuthRoleNaming to clarify its purpose within @RolesAllowed annotations. Removed the unused constant `PIC_SURE_TOP_ADMIN`.
* Simplify role deletion logic
Removed security context checks in `RoleService` to streamline role deletion. The removeById RoleController endpoint already verifies the user is a SUPER_ADMIN. The privilege is only assigned to PIC-SURE Top Admins.
* Refactor RoleService tests and remove unnecessary methods
Consolidated RoleService test cases by removing duplicate methods and irrelevant tests.
* Cleaned up JWTFilter comments
0 commit comments