alfresco-ng2-components/docs/core/services/identity-user.service.md
tomgny d3f99a74b0
[AAE-5960] Storybook stories for PeopleCloud component (#7313)
* [AAE-5953] solved rebase conflict

:wq

* [AAE-5953] solved rebase conflict

* [AAE-5953] added form cloud service interface

* [AAE-5953] fixed lint errors

* [AAE-5953] migrated stories and mocks

* [AAE-5953] migrated task cloud service mock

* [AAE-5953] migrated task cloud service mock

* [AAE-5953] removed redundant mock

* [AAE-5953] refactored and moved  mocks

* [AAE-5953] refactor modules import

* [AAE-5960] added stories file and service mock

* [AAE-5960] fixed validation mock

* [AAE-5960] added story for user role

* [AAE-5960] removed uunused properties from primary story

* [AAE-5960] added interface to mock and live identity user service

* [AAE-5960] added mandatory preselected users story

* [AAE-5960] syntax improvements

* [AAE-5960] fixed default value for roles control

* [AAE-5960] refactored imports

* [AAE-5960] improve syntax

* [AAE-5960] refactored services name

* [AAE-5960] removed deprecated argTypes defaultValue

* [AAE-5960] exported new interface from core

* [AAE-5960] fixed import issue with identity user mock service in core

* [AAE-5960] fixed issue with viewer component test
2021-10-22 15:54:56 +01:00

14 KiB

Title, Added, Status, Last reviewed
Title Added Status Last reviewed
Identity user service v3.0.0 Active 2019-07-12

Identity user service

Gets OAuth2 personal details and roles for users and performs CRUD operations on identity users.

Class members

Methods

  • assignRoles(userId: string, roles: IdentityRoleModel[]): Observable<any>
    Assigns roles to the user.
    • userId: string - Id of the user.
    • roles: IdentityRoleModel[] - Array of roles.
    • Returns Observable<any> - Empty response when the role assigned.
  • changePassword(userId: string, newPassword: IdentityUserPasswordModel): Observable<any>
    Changes user password.
  • checkUserHasAnyApplicationRole(userId: string, applicationName: string, roleNames: string[]): Observable<boolean>
    Checks if a user has any application role.
    • userId: string - ID of the target user
    • applicationName: string - Name of the application
    • roleNames: string[] - List of role names to check for
    • Returns Observable<boolean> - True if the user has one or more of the roles, false otherwise
  • checkUserHasAnyClientAppRole(userId: string, clientId: string, roleNames: string[]): Observable<boolean>
    Checks whether a user has any of the client app roles.
    • userId: string - ID of the target user
    • clientId: string - ID of the client app
    • roleNames: string[] - List of role names to check for
    • Returns Observable<boolean> - True if the user has one or more of the roles, false otherwise
  • checkUserHasApplicationAccess(userId: string, applicationName: string): Observable<boolean>
    Checks if a user has access to an application.
    • userId: string - ID of the user
    • applicationName: string - Name of the application
    • Returns Observable<boolean> - True if the user has access, false otherwise
  • checkUserHasClientApp(userId: string, clientId: string): Observable<boolean>
    Checks whether user has access to a client app.
    • userId: string - ID of the target user
    • clientId: string - ID of the client app
    • Returns Observable<boolean> - True if the user has access, false otherwise
  • checkUserHasRole(userId: string, roleNames: string[]): Observable<boolean>
    Checks if a user has one of the roles from a list.
    • userId: string - ID of the target user
    • roleNames: string[] - Array of roles to check for
    • Returns Observable<boolean> - True if the user has one of the roles, false otherwise
  • createUser(newUser: IdentityUserModel): Observable<any>
    Creates new user.
  • deleteUser(userId: string): Observable<any>
    Deletes User.
    • userId: string - Id of the user.
    • Returns Observable<any> - Empty response when the user deleted.
  • findUserByEmail(email: string): Observable<IdentityUserModel[]>
    Find users based on email input.
  • findUserById(id: string): Observable<any>
    Find users based on id input.
    • id: string - Search query string
    • Returns Observable<any> - users object
  • findUserByUsername(username: string): Observable<IdentityUserModel[]>
    Find users based on username input.
  • findUsersByName(search: string): Observable<IdentityUserModel[]>
    Find users based on search input.
  • getAssignedRoles(userId: string): Observable<IdentityRoleModel[]>
    Gets assigned roles.
  • getAvailableRoles(userId: string): Observable<IdentityRoleModel[]>
    Gets available roles
  • getClientIdByApplicationName(applicationName: string): Observable<string>
    Gets the client ID for an application.
    • applicationName: string - Name of the application
    • Returns Observable<string> - Client ID string
  • getClientRoles(userId: string, clientId: string): Observable<any[]>
    Get client roles of a user for a particular client.
    • userId: string - ID of the target user
    • clientId: string - ID of the client app
    • Returns Observable<any[]> - List of client roles
  • getCurrentUserInfo(): IdentityUserModel
    Gets the name and other basic details of the current user.
  • getEffectiveRoles(userId: string): Observable<IdentityRoleModel[]>
    Gets effective roles.
  • getInvolvedGroups(userId: string): Observable<IdentityGroupModel[]>
    Gets involved groups.
  • getTotalUsersCount(): Observable<number>
    Gets users total count.
    • Returns Observable<number> - Number of users count.
  • getUserRoles(userId: string): Observable<IdentityRoleModel[]>
    Gets a list of roles for a user.
  • getUsers(): Observable<IdentityUserModel[]>
    Gets details for all users.
  • getUsersByRolesWithCurrentUser(roleNames: string[]): Promise<IdentityUserModel[]>
    Gets an array of users (including the current user) who have any of the roles in the supplied list.
    • roleNames: string[] - List of role names to look for
    • Returns Promise<IdentityUserModel[]> - Array of user info objects
  • getUsersByRolesWithoutCurrentUser(roleNames: string[]): Promise<IdentityUserModel[]>
    Gets an array of users (not including the current user) who have any of the roles in the supplied list.
    • roleNames: string[] - List of role names to look for
    • Returns Promise<IdentityUserModel[]> - Array of user info objects
  • joinGroup(joinGroupRequest: IdentityJoinGroupRequestModel): Observable<any>
    Joins group.
  • leaveGroup(userId: any, groupId: string): Observable<any>
    Leaves group.
    • userId: any - Id of the user.
    • groupId: string - Id of the group.
    • Returns Observable<any> - Empty response when the user left the group.
  • queryUsers(requestQuery: IdentityUserQueryCloudRequestModel): Observable<IdentityUserQueryResponse>
    Gets details for all users.
  • removeRoles(userId: string, removedRoles: IdentityRoleModel[]): Observable<any>
    Removes assigned roles.
  • updateUser(userId: string, updatedUser: IdentityUserModel): Observable<any>
    Updates user details.
    • userId: string - Id of the user.
    • updatedUser: IdentityUserModel - Object containing the user details.
    • Returns Observable<any> - Empty response when the user updated.

See also