Skip to content

Commit

Permalink
Merge pull request #54 from arati-tekdi/main
Browse files Browse the repository at this point in the history
Change in sequence for APIs
  • Loading branch information
Shubham4026 authored Nov 20, 2024
2 parents 1312897 + 89a0b2d commit 7cd10a4
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/common/middleware/apiConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ const rolesGroup = {
'central_admin_mme',
],
team_leader_teacher: ['teacher', 'team_leader', 'state_admin_mme'],
admin_team_leader_teacher_state_admin_scta: [
'admin',
'teacher',
'team_leader',
'state_admin_mme',
'central_admin_mme',
'state_admin_scta',
],
};
const createPrivilegeGroup = (entity: string) => {
return {
Expand Down Expand Up @@ -160,7 +168,7 @@ export const apiList = {
'/user/v1/read/:userId': createRouteObject({
get: {
PRIVILEGE_CHECK: privilegeGroup.users.read,
ROLE_CHECK: rolesGroup.admin_team_leader_teacher,
ROLE_CHECK: rolesGroup.admin_team_leader_teacher_state_admin_scta,
},
}),
'/user/v1/update/:userId': createRouteObject({
Expand Down Expand Up @@ -319,14 +327,14 @@ export const apiList = {
ROLE_CHECK: rolesGroup.admin_team_leader,
},
}),

'/user/v1/rbac/privileges/:privilegeId': createRouteObject({
get: {
// add create first
'/user/v1/rbac/privileges/create': createRouteObject({
post: {
ROLE_CHECK: rolesGroup.admin_team_leader,
},
}),
'/user/v1/rbac/privileges/create': createRouteObject({
post: {
'/user/v1/rbac/privileges/:privilegeId': createRouteObject({
get: {
ROLE_CHECK: rolesGroup.admin_team_leader,
},
}),
Expand Down

0 comments on commit 7cd10a4

Please sign in to comment.