mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
add missing group role APIs (#6057)
* add missing group role apis * add missing "assign" and "remove" api
This commit is contained in:
@@ -60,6 +60,50 @@ export class IdentityGroupService {
|
|||||||
return this.oAuth2Service.get({ url });
|
return this.oAuth2Service.get({ url });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets assigned roles
|
||||||
|
* @param groupId Id of the group.
|
||||||
|
* @returns Array of available roles
|
||||||
|
*/
|
||||||
|
getAssignedRoles(groupId: string): Observable<IdentityRoleModel[]> {
|
||||||
|
const url = `${this.identityHost}/groups/${groupId}/role-mappings/realm`;
|
||||||
|
return this.oAuth2Service.get({ url });
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Assigns roles to the group
|
||||||
|
* @param groupId The ID of the group
|
||||||
|
* @param roles Array of roles to assign
|
||||||
|
*/
|
||||||
|
assignRoles(groupId: string, roles: IdentityRoleModel[]): Observable<any> {
|
||||||
|
const url = `${this.identityHost}/groups/${groupId}/role-mappings/realm`;
|
||||||
|
const bodyParam = JSON.stringify(roles);
|
||||||
|
|
||||||
|
return this.oAuth2Service.post({ url, bodyParam });
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes roles from the group
|
||||||
|
* @param groupId The ID of the group
|
||||||
|
* @param roles Array of roles to remove
|
||||||
|
*/
|
||||||
|
removeRoles(groupId: string, roles: IdentityRoleModel[]): Observable<any> {
|
||||||
|
const url = `${this.identityHost}/groups/${groupId}/role-mappings/realm`;
|
||||||
|
const bodyParam = JSON.stringify(roles);
|
||||||
|
|
||||||
|
return this.oAuth2Service.delete({ url, bodyParam });
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get effective roles
|
||||||
|
* @param groupId Id of the group
|
||||||
|
* @returns Array of effective roles
|
||||||
|
*/
|
||||||
|
getEffectiveRoles(groupId: string): Observable<IdentityRoleModel[]> {
|
||||||
|
const url = `${this.identityHost}/groups/${groupId}/role-mappings/realm/composite`;
|
||||||
|
return this.oAuth2Service.get({ url });
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Queries groups.
|
* Queries groups.
|
||||||
* @returns Array of user information objects
|
* @returns Array of user information objects
|
||||||
|
Reference in New Issue
Block a user