mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-8748] - Auth guards call api when access is not in JWT (#7662)
* [AAE-8748] - Auth guards call api when access is not in JWT * [ci:force] fix unit tests * Remove fdescribe * Add documentation and unit tests for the user access service * Rename mocks, make e2e independent * Fix login e2e * Move forbidden access e2e under cloud
This commit is contained in:
27
docs/core/services/user-access.service.md
Normal file
27
docs/core/services/user-access.service.md
Normal file
@@ -0,0 +1,27 @@
|
||||
---
|
||||
Title: User access service
|
||||
Added: v1.0.0
|
||||
Status: Active
|
||||
Last reviewed: 2022-06-05
|
||||
---
|
||||
|
||||
# [User access service](../../../lib/core/services/user-access.service.ts "Defined in user-access.service.ts")
|
||||
|
||||
Checks the global and application access of a user
|
||||
|
||||
## Class members
|
||||
|
||||
### Methods
|
||||
- **fetchUserAccess**()<br/>
|
||||
Fetches the global and application access of the user
|
||||
- **hasApplicationAccess**(appName: `string`, rolesToCheck: string[]): `boolean`<br/>
|
||||
Checks if the user has at least one of the roles to check for a given app.
|
||||
- appName: `string` - The name of the app
|
||||
- rolesToCheck: `string[]` - The roles to check
|
||||
- **Returns** `boolean` - True if it contains at least one of the given roles to check for the given app, false otherwise
|
||||
- **hasGlobalAccess**(rolesToCheck: string[]): `boolean`<br/>
|
||||
Checks if the user has at least one of the given roles to check in the global roles.
|
||||
- rolesToCheck: `string[]` - The roles to check
|
||||
- **Returns** `boolean` - True if it contains at least one of the given roles to check, false otherwise
|
||||
- **resetAccess**() <br>
|
||||
Resets the cached access of the user
|
Reference in New Issue
Block a user