mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-09-07 16:35:43 +00:00
feat: implement permission-based access control across various pages and components
- Added RequirePermission component to manage access based on user permissions. - Integrated permission checks in MySeaRecordsPage, SeafarerRegistrationPage, VesselRegistrationPage, WaiverPage, and PortalLayout. - Updated router to enforce permissions for specific routes. - Introduced PORTAL_PERMISSIONS and LICENSE_PERMISSIONS constants for consistent permission management. - Enhanced usePermissions hook to fetch permissions from the server and determine access rights. - Refactored UI components to conditionally render based on user permissions, improving security and user experience.
This commit is contained in:
@@ -85,6 +85,12 @@ export interface ProfileMeResponse {
|
||||
profile: CurrentProfile;
|
||||
completeness: number;
|
||||
missing: ProfileField[];
|
||||
/**
|
||||
* Every permission key the caller effectively holds (role + portal
|
||||
* account-type + position grants), computed server-side. Feeds
|
||||
* `usePermissions()`.
|
||||
*/
|
||||
permissions?: string[];
|
||||
}
|
||||
|
||||
const profileApi = baseApi
|
||||
|
||||
Reference in New Issue
Block a user