Roles and rules based access control library for angular version 1.
To install this library, run:
$ npm install @doce/ngx-rbac --save
<do-provide-rules></do-provide-rules>
Properties | Type | Description |
---|---|---|
rules | DoStringDictionary<DoRuleType> | DoRuleType | Input a rules here to provide them on the current level |
roles | DoRuleType[] | Input a roles here to provide them on the current level |
DoCanGuard
Arguments | Type | Description |
---|---|---|
rules | string[] | The array of rule names |
doCan
Arguments | Type | Description |
---|---|---|
rules | string | AllPossibleCheckers[] | AllPossibleCheckers | DoRuleType | Test criteria |
- doCreateRole(name: string): DoRoleType
- doCreatePermission(name: string): DoRolePermissionType
- doCreatePermissions(names: string[]): DoRolePermissionType[]
-
doCreateRuleSet(ruleSet: DoRuleSet, options?: DoRuleOptions): DoStringDictionary<DoRule>
-
doCreateRule(name: string, checkers: AllPossibleCheckers[], options?:DoRuleOptions): DoRuleType
-
doExtendRule(name: string, checkers: AllPossibleCheckers[]): DoStringDictionary<DoRule>
-
doSimpleRule(name: string, options?:DoRuleOptions): { [name]: doCreateRule(name, [() => true], options) }
-
doNot(checkers: AllPossibleCheckers, options: DoRuleOptions): DoRuleType
-
doOr(checkers: AllPossibleCheckers, options: DoRuleOptions): DoRuleType
-
doAnd(checkers: AllPossibleCheckers, options: DoRuleOptions): DoRuleType
DoRuleType | DoRoleType | DoCheckerFunction | string;
{
[ruleName: string]: AllPossibleCheckers[]
}
{
absentRuleBehavior?: DoAbsentRuleBehavior;
groupName?: string;
}
(args: any[], dependency: Dependency) => boolean
[DoRoleType[], DoStringDictionary<DoRuleType>]
{
addPermissionsOf(child: DoRolePermissionType): void;
addRule(rule: DoRuleType | DoStringDictionary<DoRuleType>): void;
}
{
[key: string]: T;
}
{
can: DoStringDictionary<DoRuleType>;
canNames: string[];
name: string;
}