Authorizations
avUserAuthorizations
is a service that allows you to get user and
permission information.
Configuration
Initialize the availity
module in your application.
angular.module('app', ['availity']);
Usage
angular.module('app', ['availity'])
.factory('authenticationService', avUserAuthorizations => {
class AuthenticationService {
constructor() {
avUserAuthorized.isAuthorized('7100').then(isAuthorized => {
this.isAuthorized = isAuthorized;
});
}
}
return new AuthenticationService();
});
Methods
avUserAuthorizations
contains the following methods.
isAuthorized
Returns true
if the current user is authorized for the specified permission.
avUserAuthorizations.isAuthorized(permissionId);
isAnyAuthorized
Returns true
if the current user is authorized for at least one of the specified permissions.
avUserAuthorizations.isAnyAuthorized([permissionId1, permissionId2]);
getPermission
Returns the permission having the specified permissionId.
avUserAuthorizations.getPermission(permissionId);
getPermissions
Returns the permissions having the specified permissionIds.
avUserAuthorizations.getPermissions([permissionId1, permissionId2]);
getOrganizations
Returns the user's organizations that have access to the specified permissionId.
avUserAuthorizations.getOrganizations(permissionId);
getPayers
Returns the payers the user has access to for the specified permissionId and organizationId.
avUserAuthorization.getPayers(permissionId, organizationId);