@yelon/acl 15.1.2 → 15.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +23 -23
- package/esm2020/acl.mjs +4 -4
- package/esm2020/index.mjs +7 -7
- package/esm2020/src/acl-guard.mjs +57 -57
- package/esm2020/src/acl-if.directive.mjs +78 -78
- package/esm2020/src/acl.config.mjs +3 -3
- package/esm2020/src/acl.directive.mjs +47 -47
- package/esm2020/src/acl.module.mjs +26 -26
- package/esm2020/src/acl.service.mjs +194 -194
- package/esm2020/src/acl.type.mjs +6 -6
- package/fesm2015/acl.mjs +395 -395
- package/fesm2015/acl.mjs.map +1 -1
- package/fesm2020/acl.mjs +405 -405
- package/fesm2020/acl.mjs.map +1 -1
- package/index.d.ts +7 -7
- package/package.json +51 -51
- package/src/acl-guard.d.ts +28 -28
- package/src/acl-if.directive.d.ts +26 -26
- package/src/acl.config.d.ts +2 -2
- package/src/acl.directive.d.ts +18 -18
- package/src/acl.module.d.ts +11 -11
- package/src/acl.service.d.ts +78 -78
- package/src/acl.type.d.ts +32 -32
- package/src/style/index.less +7 -7
package/src/acl.type.d.ts
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* NOTE:`ACLType` 类型可能会被其他类库所引用,为了减少类库间彼此的依赖性,其他类库会以复制的形式存在
|
|
3
|
-
* 当这里有变化时,请务必同步更新,涉及:`MenuService.acl`、`util.YunzaiACLType`
|
|
4
|
-
* TODO: 尝试增加 `@yelon/core` 类库用于处理这种通用型
|
|
5
|
-
*/
|
|
6
|
-
import { Injector } from '@angular/core';
|
|
7
|
-
import { Observable } from 'rxjs';
|
|
8
|
-
import type { ACLService } from './acl.service';
|
|
9
|
-
export interface ACLType {
|
|
10
|
-
/**
|
|
11
|
-
* 角色
|
|
12
|
-
*/
|
|
13
|
-
role?: string[];
|
|
14
|
-
/**
|
|
15
|
-
* 权限点
|
|
16
|
-
*/
|
|
17
|
-
ability?: number[] | string[];
|
|
18
|
-
/**
|
|
19
|
-
* Validated against, default: `oneOf`
|
|
20
|
-
* - `allOf` the value validates against all the roles or abilities
|
|
21
|
-
* - `oneOf` the value validates against exactly one of the roles or abilities
|
|
22
|
-
*/
|
|
23
|
-
mode?: 'allOf' | 'oneOf';
|
|
24
|
-
/**
|
|
25
|
-
* 是否取反,即结果为 `true` 时表示未授权
|
|
26
|
-
*/
|
|
27
|
-
except?: boolean;
|
|
28
|
-
[key: string]: any;
|
|
29
|
-
}
|
|
30
|
-
export type ACLCanType = number | number[] | string | string[] | ACLType;
|
|
31
|
-
export type ACLGuardFunctionType = (srv: ACLService, injector: Injector) => Observable<ACLCanType>;
|
|
32
|
-
export type ACLGuardType = ACLCanType | Observable<ACLCanType> | ACLGuardFunctionType;
|
|
1
|
+
/**
|
|
2
|
+
* NOTE:`ACLType` 类型可能会被其他类库所引用,为了减少类库间彼此的依赖性,其他类库会以复制的形式存在
|
|
3
|
+
* 当这里有变化时,请务必同步更新,涉及:`MenuService.acl`、`util.YunzaiACLType`
|
|
4
|
+
* TODO: 尝试增加 `@yelon/core` 类库用于处理这种通用型
|
|
5
|
+
*/
|
|
6
|
+
import { Injector } from '@angular/core';
|
|
7
|
+
import { Observable } from 'rxjs';
|
|
8
|
+
import type { ACLService } from './acl.service';
|
|
9
|
+
export interface ACLType {
|
|
10
|
+
/**
|
|
11
|
+
* 角色
|
|
12
|
+
*/
|
|
13
|
+
role?: string[];
|
|
14
|
+
/**
|
|
15
|
+
* 权限点
|
|
16
|
+
*/
|
|
17
|
+
ability?: number[] | string[];
|
|
18
|
+
/**
|
|
19
|
+
* Validated against, default: `oneOf`
|
|
20
|
+
* - `allOf` the value validates against all the roles or abilities
|
|
21
|
+
* - `oneOf` the value validates against exactly one of the roles or abilities
|
|
22
|
+
*/
|
|
23
|
+
mode?: 'allOf' | 'oneOf';
|
|
24
|
+
/**
|
|
25
|
+
* 是否取反,即结果为 `true` 时表示未授权
|
|
26
|
+
*/
|
|
27
|
+
except?: boolean;
|
|
28
|
+
[key: string]: any;
|
|
29
|
+
}
|
|
30
|
+
export type ACLCanType = number | number[] | string | string[] | ACLType;
|
|
31
|
+
export type ACLGuardFunctionType = (srv: ACLService, injector: Injector) => Observable<ACLCanType>;
|
|
32
|
+
export type ACLGuardType = ACLCanType | Observable<ACLCanType> | ACLGuardFunctionType;
|
package/src/style/index.less
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* [ACL](https://ng.yunzainfo.com/acl/control) 使用 `display: none` 隐藏未授权元素
|
|
3
|
-
* [ACL](https://ng.yunzainfo.com/acl/control) Hides the unauthorized element with `display: none`
|
|
4
|
-
*/
|
|
5
|
-
.acl__hide {
|
|
6
|
-
display: none !important;
|
|
7
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* [ACL](https://ng.yunzainfo.com/acl/control) 使用 `display: none` 隐藏未授权元素
|
|
3
|
+
* [ACL](https://ng.yunzainfo.com/acl/control) Hides the unauthorized element with `display: none`
|
|
4
|
+
*/
|
|
5
|
+
.acl__hide {
|
|
6
|
+
display: none !important;
|
|
7
|
+
}
|