Skip to content

Commit 651f0f6

Browse files
committed
Role management updates
1 parent fddba32 commit 651f0f6

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/apps/admin/src/lib/services/roles.service.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44
import _ from 'lodash'
55

66
import { EnvironmentConfig } from '~/config'
7-
import { xhrDeleteAsync, xhrGetAsync, xhrPostAsync } from '~/libs/core'
7+
import {
8+
xhrDeleteAsync,
9+
xhrGetAsync,
10+
xhrPatchAsync,
11+
xhrPostAsync,
12+
} from '~/libs/core'
813

914
import { adjustUserRoleResponse, UserRole } from '../models'
1015

@@ -63,9 +68,9 @@ export const createRole = async (roleName: string): Promise<UserRole> => {
6368
export const assignRole = async (
6469
roleId: string,
6570
userId: string,
66-
): Promise<string> => xhrPostAsync<undefined, string>(
67-
`${EnvironmentConfig.API.V6}/roles/${roleId}/assign?action=true&filter=subjectID%3D${userId}`,
68-
undefined,
71+
): Promise<string> => xhrPatchAsync<{ roleId: string }, string>(
72+
`${EnvironmentConfig.API.V6}/user-roles/${userId}`,
73+
{ roleId },
6974
)
7075

7176
/**
@@ -78,7 +83,7 @@ export const unassignRole = async (
7883
roleId: string,
7984
userId: string,
8085
): Promise<string> => xhrDeleteAsync<string>(
81-
`${EnvironmentConfig.API.V6}/roles/${roleId}/deassign?action=true&filter=subjectID%3D${userId}`,
86+
`${EnvironmentConfig.API.V6}/user-roles/${userId}/${roleId}`,
8287
)
8388

8489
/**

src/config/environments/default.env.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,7 @@ export const VANILLA_FORUM = {
6161
V2_URL: 'https://vanilla.topcoder-dev.com/api/v2',
6262
}
6363

64-
const ADMIN_SSO_LOGIN_PROVIDERS_ENV = getReactEnv<string | undefined>(
65-
'ADMIN_SSO_LOGIN_PROVIDERS',
66-
undefined,
67-
)
64+
const ADMIN_SSO_LOGIN_PROVIDERS_ENV = '[{"ssoLoginProviderId":1,"name":"okta-customer","type":"samlp"}]'
6865

6966
export const ADMIN_SSO_LOGIN_PROVIDERS: SSOLoginProviderConfig[] = parseSSOLoginProviders(
7067
ADMIN_SSO_LOGIN_PROVIDERS_ENV,

0 commit comments

Comments
 (0)