@alfresco/adf-core
Version:
149 lines (148 loc) • 5.43 kB
TypeScript
import { Observable } from 'rxjs';
import { AppConfigService } from '../../app-config/app-config.service';
import { IdentityGroupSearchParam, IdentityGroupQueryCloudRequestModel, IdentityGroupModel, IdentityGroupQueryResponse, IdentityGroupCountModel } from '../models/identity-group.model';
import { IdentityRoleModel } from '../models/identity-role.model';
import { IdentityGroupServiceInterface } from '../interfaces/identity-group.interface';
import { OAuth2Service } from './oauth2.service';
import * as i0 from "@angular/core";
export declare class IdentityGroupService implements IdentityGroupServiceInterface {
private oAuth2Service;
private appConfigService;
constructor(oAuth2Service: OAuth2Service, appConfigService: AppConfigService);
private get identityHost();
/**
* Gets all groups.
*
* @returns Array of group information objects
*/
getGroups(): Observable<IdentityGroupModel[]>;
/**
* Gets available roles
*
* @param groupId Id of the group.
* @returns Array of available roles information objects
*/
getAvailableRoles(groupId: string): Observable<IdentityRoleModel[]>;
/**
* Gets assigned roles
*
* @param groupId Id of the group.
* @returns Array of available roles
*/
getAssignedRoles(groupId: string): Observable<IdentityRoleModel[]>;
/**
* Assigns roles to the group
*
* @param groupId The ID of the group
* @param roles Array of roles to assign
* @returns request result
*/
assignRoles(groupId: string, roles: IdentityRoleModel[]): Observable<any>;
/**
* Removes roles from the group
*
* @param groupId The ID of the group
* @param roles Array of roles to remove
* @returns request result
*/
removeRoles(groupId: string, roles: IdentityRoleModel[]): Observable<any>;
/**
* Get effective roles
*
* @param groupId Id of the group
* @returns Array of effective roles
*/
getEffectiveRoles(groupId: string): Observable<IdentityRoleModel[]>;
/**
* Queries groups.
*
* @param requestQuery query settings
* @returns Array of user information objects
*/
queryGroups(requestQuery: IdentityGroupQueryCloudRequestModel): Observable<IdentityGroupQueryResponse>;
/**
* Gets groups total count.
*
* @returns Number of groups count.
*/
getTotalGroupsCount(): Observable<IdentityGroupCountModel>;
/**
* Creates new group.
*
* @param newGroup Object of containing the new group details.
* @returns Empty response when the group created.
*/
createGroup(newGroup: IdentityGroupModel): Observable<any>;
/**
* Updates group details.
*
* @param groupId Id of the targeted group.
* @param updatedGroup Object of containing the group details
* @returns Empty response when the group updated.
*/
updateGroup(groupId: string, updatedGroup: IdentityGroupModel): Observable<any>;
/**
* Deletes Group.
*
* @param groupId Id of the group.
* @returns Empty response when the group deleted.
*/
deleteGroup(groupId: string): Observable<any>;
/**
* Finds groups filtered by name.
*
* @param searchParams Object containing the name filter string
* @returns List of group information
*/
findGroupsByName(searchParams: IdentityGroupSearchParam): Observable<IdentityGroupModel[]>;
/**
* Gets details for a specified group.
*
* @param groupId Id of the target group
* @returns Group details
*/
getGroupRoles(groupId: string): Observable<IdentityRoleModel[]>;
/**
* Check that a group has one or more roles from the supplied list.
*
* @param groupId Id of the target group
* @param roleNames Array of role names
* @returns True if the group has one or more of the roles, false otherwise
*/
checkGroupHasRole(groupId: string, roleNames: string[]): Observable<boolean>;
/**
* Gets the client Id using the app name.
*
* @param applicationName Name of the app
* @returns client Id string
*/
getClientIdByApplicationName(applicationName: string): Observable<string>;
/**
* Gets client roles.
*
* @param groupId Id of the target group
* @param clientId Id of the client
* @returns List of roles
*/
getClientRoles(groupId: string, clientId: string): Observable<IdentityRoleModel[]>;
/**
* Checks if a group has a client app.
*
* @param groupId Id of the target group
* @param clientId Id of the client
* @returns True if the group has the client app, false otherwise
*/
checkGroupHasClientApp(groupId: string, clientId: string): Observable<boolean>;
/**
* Check if a group has any of the client app roles in the supplied list.
*
* @param groupId Id of the target group
* @param clientId Id of the client
* @param roleNames Array of role names to check
* @returns True if the group has one or more of the roles, false otherwise
*/
checkGroupHasAnyClientAppRole(groupId: string, clientId: string, roleNames: string[]): Observable<boolean>;
private buildRolesUrl;
static ɵfac: i0.ɵɵFactoryDeclaration<IdentityGroupService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<IdentityGroupService>;
}