mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
6.5 KiB
6.5 KiB
Title, Added, Status, Last reviewed
Title | Added | Status | Last reviewed |
---|---|---|---|
Identity user service | v3.0.0 | Active | 2019-01-23 |
Identity user service
Gets OAuth2 personal details and roles for users.
Class members
Methods
- 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
- userId:
- 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
- userId:
- 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
- userId:
- 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
- userId:
- findUsersByName(search:
string
):Observable
<any>
Find users based on search input.- search:
string
- Search query string - Returns
Observable
<any>
- List of users
- search:
- getClientIdByApplicationName(applicationName:
string
):Observable
<string>
Gets the client ID for an application.- applicationName:
string
- Name of the application - Returns
Observable
<string>
- Client ID string
- applicationName:
- 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
- userId:
- getCurrentUserInfo():
IdentityUserModel
Gets the name and other basic details of the current user.- Returns
IdentityUserModel
- The user's details
- Returns
- getUserRoles(userId:
string
):Observable
<
IdentityRoleModel
[]>
Gets a list of roles for a user.- userId:
string
- ID of the user - Returns
Observable
<
IdentityRoleModel
[]>
- Array of role info objects
- userId:
- getUsers():
Observable
<
IdentityUserModel
[]>
Gets details for all users.- Returns
Observable
<
IdentityUserModel
[]>
- Array of user info objects
- Returns
- 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
- roleNames:
- 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
- roleNames:
- getValueFromToken(key:
string
)
Gets a named value from the user access token.- key:
string
- Key name of the field to retrieve
- key:
Details
OAuth2 defines an access token (used when authenticating a user) and a number of authentication roles that the user can participate in (see this page for an introduction to OAuth2 and a description of the roles). You can use the Identity user service to access this information for users, including the current user.