Files
alfresco-ng2-components/docs/core/services/user-access.service.md
Ardit Domi d8a4b5bcdb [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
2022-06-07 10:21:54 +02:00

1.1 KiB

Title, Added, Status, Last reviewed
Title Added Status Last reviewed
User access service v1.0.0 Active 2022-06-05

User access service

Checks the global and application access of a user

Class members

Methods

  • fetchUserAccess()
    Fetches the global and application access of the user
  • hasApplicationAccess(appName: string, rolesToCheck: string[]): boolean
    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
    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()
    Resets the cached access of the user