mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
perf(projects): add detailed annotations for route role
This commit is contained in:
@ -25,6 +25,10 @@ export function createPermissionGuard(router: Router) {
|
||||
const loginRoute: RouteKey = 'login';
|
||||
const noPermissionRoute: RouteKey = '403';
|
||||
|
||||
// check whether the user has permission to access the route
|
||||
// 1. if the route's "roles" is empty, then it is allowed to access
|
||||
// 2. if the user is super admin, then it is allowed to access
|
||||
// 3. if the user's role is included in the route's "roles", then it is allowed to access
|
||||
const SUPER_ADMIN = 'R_SUPER';
|
||||
const hasPermission =
|
||||
!routeRoles.length ||
|
||||
|
Reference in New Issue
Block a user