0.0.0 • Published 1 year ago
@iac-mchs/ngx-rule-role-access v0.0.0
NgxRbac
Roles and rules based access control library for angular version 1.
Installation
To install this library, run:
$ npm install @doce/ngx-rbac --save Tools
Component
<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 |
Guard
DoCanGuard| Arguments | Type | Description |
|---|---|---|
| rules | string[] | The array of rule names |
Pipe
doCan
| Arguments | Type | Description |
|---|---|---|
| rules | string | AllPossibleCheckers[] | AllPossibleCheckers | DoRuleType | Test criteria |
Functions
For Roles:
- doCreateRole(name: string): DoRoleType
For Permissions:
- doCreatePermission(name: string): DoRolePermissionType
- doCreatePermissions(names: string[]): DoRolePermissionType[]
For Rules:
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) }
Logical:
doNot(checkers: AllPossibleCheckers, options: DoRuleOptions): DoRuleType
doOr(checkers: AllPossibleCheckers, options: DoRuleOptions): DoRuleType
doAnd(checkers: AllPossibleCheckers, options: DoRuleOptions): DoRuleType
Explanations
AllPossibleCheckers
DoRuleType | DoRoleType | DoCheckerFunction | string;DoRuleSet
{
[ruleName: string]: AllPossibleCheckers[]
}DoRuleOptions
{
absentRuleBehavior?: DoAbsentRuleBehavior;
groupName?: string;
}DoCheckerFunction
(args: any[], dependency: Dependency) => booleanDependency
[DoRoleType[], DoStringDictionary<DoRuleType>]DoRuleType
{
addPermissionsOf(child: DoRolePermissionType): void;
addRule(rule: DoRuleType | DoStringDictionary<DoRuleType>): void;
}DoStringDictionary\
{
[key: string]: T;
}DoRolePermissionType
{
can: DoStringDictionary<DoRuleType>;
canNames: string[];
name: string;
}0.0.0
1 year ago