@holoyan/adonisjs-permissions 1.0.0 → 1.0.2
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/README.md
CHANGED
|
@@ -132,8 +132,8 @@ export default class Post extends BaseModel implements AclModelInterface {
|
|
|
132
132
|
|
|
133
133
|
## Release Notes
|
|
134
134
|
|
|
135
|
-
Version: >=
|
|
136
|
-
*
|
|
135
|
+
Version: >= v1.0.2
|
|
136
|
+
* Update: Mixin getModelId method return type
|
|
137
137
|
|
|
138
138
|
## Mixins
|
|
139
139
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { NormalizeConstructor } from '@adonisjs/core/types/helpers';
|
|
2
|
-
import { AclModel } from '../types.js';
|
|
2
|
+
import { AclModel, ModelIdType } from '../types.js';
|
|
3
3
|
export declare function hasPermissions(): <Model extends NormalizeConstructor<import("@adonisjs/lucid/types/model").LucidModel>>(superclass: Model) => {
|
|
4
4
|
new (...args: any[]): {
|
|
5
|
-
getModelId():
|
|
5
|
+
getModelId(): ModelIdType;
|
|
6
6
|
roles(): import("@adonisjs/lucid/types/model").ModelQueryBuilderContract<import("@adonisjs/lucid/types/model").LucidModel, import("../types.js").RoleModel<import("@adonisjs/lucid/types/model").LucidModel>>;
|
|
7
7
|
hasRole(role: string): Promise<boolean>;
|
|
8
8
|
hasAllRoles(...roles: string[]): Promise<boolean>;
|
|
@@ -15,7 +15,7 @@ export default class UserScopeMiddleware {
|
|
|
15
15
|
//@ts-ignore
|
|
16
16
|
async handle(ctx: HttpContext, next: NextFn) {
|
|
17
17
|
const scope = new Scope()
|
|
18
|
-
ctx.acl = new AclManager().scope(scope)
|
|
18
|
+
ctx.acl = new AclManager(true).scope(scope)
|
|
19
19
|
/**
|
|
20
20
|
* Call next method in the pipeline and return its output
|
|
21
21
|
*/
|