add group from keycloak
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 7s
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 7s
This commit is contained in:
parent
3bf2446611
commit
94c7de89eb
3 changed files with 92 additions and 1 deletions
|
|
@ -27,6 +27,7 @@ import {
|
|||
listRole,
|
||||
getUserRoles,
|
||||
removeUserRoles,
|
||||
getGroupUser,
|
||||
} from "../services/keycloak";
|
||||
import { isSystem } from "../utils/keycloak";
|
||||
import {
|
||||
|
|
@ -947,3 +948,17 @@ export class UserSignatureController extends Controller {
|
|||
await deleteFile(fileLocation.user.signature(userId));
|
||||
}
|
||||
}
|
||||
|
||||
@Route("api/v1/user/{userId}/group")
|
||||
@Tags("User")
|
||||
@Security("keycloak")
|
||||
export class UserGroupController extends Controller {
|
||||
@Get()
|
||||
async getUserGroup(@Path() userId: string) {
|
||||
const groupUser = await getGroupUser(userId);
|
||||
if (!Array.isArray(groupUser))
|
||||
throw new Error("Failed. Cannot get user group(s) data from the server.");
|
||||
|
||||
return groupUser;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue