/*! * @license * Copyright 2019 Alfresco Software, Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { Pagination } from '@alfresco/js-api'; import { Observable } from 'rxjs'; import { IdentityGroupModel } from '../models/identity-group.model'; import { IdentityRoleModel } from '../models/identity-role.model'; import { IdentityUserModel } from '../models/identity-user.model'; export interface IdentityUserQueryResponse { entries: IdentityUserModel[]; pagination: Pagination; } export interface IdentityUserPasswordModel { type?: string; value?: string; temporary?: boolean; } export interface IdentityUserQueryCloudRequestModel { first: number; max: number; } export interface IdentityJoinGroupRequestModel { realm: string; userId: string; groupId: string; } export interface IdentityUserServiceInterface { getCurrentUserInfo(): IdentityUserModel; findUserById(id: string): Observable; findUsersByName(search: string): Observable; findUserByUsername(username: string): Observable; findUserByEmail(email: string): Observable; getClientRoles(userId: string, clientId: string): Observable; checkUserHasClientApp(userId: string, clientId: string): Observable; checkUserHasAnyClientAppRole(userId: string, clientId: string, roleNames: string[]): Observable; getClientIdByApplicationName(applicationName: string): Observable; checkUserHasApplicationAccess(userId: string, applicationName: string): Observable; checkUserHasAnyApplicationRole(userId: string, applicationName: string, roleNames: string[]): Observable; getUsers(): Observable; getUserRoles(userId: string): Observable; getUsersByRolesWithCurrentUser(roleNames: string[]): Promise; getUsersByRolesWithoutCurrentUser(roleNames: string[]): Promise; checkUserHasRole(userId: string, roleNames: string[]): Observable; queryUsers(requestQuery: IdentityUserQueryCloudRequestModel): Observable; getTotalUsersCount(): Observable; createUser(newUser: IdentityUserModel): Observable; updateUser(userId: string, updatedUser: IdentityUserModel): Observable; deleteUser(userId: string): Observable; changePassword(userId: string, newPassword: IdentityUserPasswordModel): Observable; getInvolvedGroups(userId: string): Observable; joinGroup(joinGroupRequest: IdentityJoinGroupRequestModel): Observable; leaveGroup(userId: any, groupId: string): Observable; getAvailableRoles(userId: string): Observable; getAssignedRoles(userId: string): Observable; getEffectiveRoles(userId: string): Observable; assignRoles(userId: string, roles: IdentityRoleModel[]): Observable; removeRoles(userId: string, removedRoles: IdentityRoleModel[]): Observable; }