Skip to content

SL 238 Fix access control#113

Open
sle3pyy wants to merge 1 commit intodevfrom
SL-238-fix-access-control
Open

SL 238 Fix access control#113
sle3pyy wants to merge 1 commit intodevfrom
SL-238-fix-access-control

Conversation

@sle3pyy
Copy link
Copy Markdown
Member

@sle3pyy sle3pyy commented Apr 16, 2026

This pull request introduces role-based access control for navigation links and routes in the web application. The main changes include adding roles metadata to navigation link definitions and implementing a centralized route access utility that checks user roles and features before allowing access to specific paths. Additionally, the root route component now enforces these access rules, redirecting unauthorized users to an appropriate default page.

Role-based navigation and route access:

  • Added a roles property to each relevant entry in adminLinks and contentManagerLinks within web/src/config/navLinks.ts to specify which user roles are allowed to access each link. [1] [2] [3] [4]
  • Created a new utility module web/src/lib/route-access.ts that builds route access policies from navigation links, normalizes user roles, and provides functions to check if a user can access a given path (canAccessPath) and to determine a default authorized path for a user (getDefaultAuthorizedPath).

Route access enforcement in root layout:

  • Updated web/src/routes/__root.tsx to use the new route access utility, extracting user roles and features from the Keycloak token, checking access for the current path, and redirecting unauthorized users to their default authorized page. Also added a loading indicator while authentication is initializing.

…admin/ from accessing content-manager/ and vice-versa. Also prevents the base user from accessing org-manager restricted content.
@github-actions
Copy link
Copy Markdown

Lint Report

Result: ✖ 153 problems (140 errors, 13 warnings)

Download Full Lint Log
(Log available in the Artifacts section at the bottom of the page)

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant