@ooneex/permission 0.0.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 -0
- package/README.md +1 -0
- package/dist/index.d.ts +109 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +12 -0
- package/package.json +42 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Ooneex
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# @ooneex/permission
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { MongoQuery as MongoQuery2 } from "@casl/ability";
|
|
2
|
+
import { IUser as IUser2 } from "@ooneex/user";
|
|
3
|
+
import { MongoQuery } from "@casl/ability";
|
|
4
|
+
import { IUser } from "@ooneex/user";
|
|
5
|
+
declare enum EPermissionAction {
|
|
6
|
+
CREATE = "create",
|
|
7
|
+
READ = "read",
|
|
8
|
+
UPDATE = "update",
|
|
9
|
+
DELETE = "delete",
|
|
10
|
+
MANAGE = "manage",
|
|
11
|
+
VIEW = "view",
|
|
12
|
+
EDIT = "edit",
|
|
13
|
+
PUBLISH = "publish",
|
|
14
|
+
ARCHIVE = "archive",
|
|
15
|
+
APPROVE = "approve",
|
|
16
|
+
REJECT = "reject",
|
|
17
|
+
DOWNLOAD = "download",
|
|
18
|
+
UPLOAD = "upload",
|
|
19
|
+
SHARE = "share",
|
|
20
|
+
COPY = "copy",
|
|
21
|
+
MOVE = "move",
|
|
22
|
+
EXPORT = "export",
|
|
23
|
+
IMPORT = "import",
|
|
24
|
+
EXECUTE = "execute",
|
|
25
|
+
ASSIGN = "assign",
|
|
26
|
+
UNASSIGN = "unassign",
|
|
27
|
+
COMMENT = "comment",
|
|
28
|
+
RATE = "rate",
|
|
29
|
+
LIKE = "like",
|
|
30
|
+
DISLIKE = "dislike",
|
|
31
|
+
FOLLOW = "follow",
|
|
32
|
+
UNFOLLOW = "unfollow",
|
|
33
|
+
SUBSCRIBE = "subscribe",
|
|
34
|
+
UNSUBSCRIBE = "unsubscribe",
|
|
35
|
+
INVITE = "invite",
|
|
36
|
+
REVOKE = "revoke",
|
|
37
|
+
GRANT = "grant",
|
|
38
|
+
DENY = "deny",
|
|
39
|
+
BLOCK = "block",
|
|
40
|
+
UNBLOCK = "unblock",
|
|
41
|
+
REPORT = "report",
|
|
42
|
+
MODERATE = "moderate",
|
|
43
|
+
BAN = "ban",
|
|
44
|
+
UNBAN = "unban",
|
|
45
|
+
RESTORE = "restore",
|
|
46
|
+
PURGE = "purge",
|
|
47
|
+
BACKUP = "backup",
|
|
48
|
+
SYNC = "sync",
|
|
49
|
+
CONFIGURE = "configure",
|
|
50
|
+
MONITOR = "monitor",
|
|
51
|
+
AUDIT = "audit",
|
|
52
|
+
SEARCH = "search",
|
|
53
|
+
FILTER = "filter",
|
|
54
|
+
SORT = "sort",
|
|
55
|
+
BOOKMARK = "bookmark",
|
|
56
|
+
TAG = "tag",
|
|
57
|
+
UNTAG = "untag",
|
|
58
|
+
LOCK = "lock",
|
|
59
|
+
UNLOCK = "unlock",
|
|
60
|
+
CLONE = "clone",
|
|
61
|
+
FORK = "fork",
|
|
62
|
+
MERGE = "merge",
|
|
63
|
+
SPLIT = "split",
|
|
64
|
+
VALIDATE = "validate",
|
|
65
|
+
VERIFY = "verify",
|
|
66
|
+
CANCEL = "cancel",
|
|
67
|
+
PAUSE = "pause",
|
|
68
|
+
RESUME = "resume",
|
|
69
|
+
SCHEDULE = "schedule",
|
|
70
|
+
UNSCHEDULE = "unschedule",
|
|
71
|
+
JOIN = "join",
|
|
72
|
+
HIDE = "hide"
|
|
73
|
+
}
|
|
74
|
+
declare enum EPermissionSubject {
|
|
75
|
+
USER_ENTITY = "UserEntity",
|
|
76
|
+
AUTH_USER_ENTITY = "AuthUserEntity",
|
|
77
|
+
AUTH_USER = "AuthUser",
|
|
78
|
+
SYSTEM_ENTITY = "SystemEntity",
|
|
79
|
+
SYSTEM = "System",
|
|
80
|
+
USER = "User",
|
|
81
|
+
ALL = "all"
|
|
82
|
+
}
|
|
83
|
+
type PermissionActionType = `${EPermissionAction}`;
|
|
84
|
+
type Subjects = `${EPermissionSubject}`;
|
|
85
|
+
type PermissionClassType = new (...args: any[]) => IPermission;
|
|
86
|
+
interface IPermission<S extends string = string> {
|
|
87
|
+
allow: (action: PermissionActionType | PermissionActionType[], subject: (Subjects | S) | (Subjects | S)[], conditions?: MongoQuery<Record<string, unknown>>) => IPermission<S>;
|
|
88
|
+
forbid: (action: PermissionActionType | PermissionActionType[], subject: (Subjects | S) | (Subjects | S)[], conditions?: MongoQuery<Record<string, unknown>>) => IPermission<S>;
|
|
89
|
+
build: () => IPermission<S>;
|
|
90
|
+
can: (action: PermissionActionType, subject: Subjects | S, field?: string) => boolean;
|
|
91
|
+
cannot: (action: PermissionActionType, subject: Subjects | S, field?: string) => boolean;
|
|
92
|
+
setCommonPermissions: (user: IUser) => IPermission<S>;
|
|
93
|
+
}
|
|
94
|
+
declare class Permission<S extends string = string> {
|
|
95
|
+
private ability;
|
|
96
|
+
private builtAbility;
|
|
97
|
+
constructor();
|
|
98
|
+
allow(action: PermissionActionType | PermissionActionType[], subject: (Subjects | S) | (Subjects | S)[], conditions?: MongoQuery2<Record<string, unknown>>): this;
|
|
99
|
+
forbid(action: PermissionActionType | PermissionActionType[], subject: (Subjects | S) | (Subjects | S)[], conditions?: MongoQuery2<Record<string, unknown>>): this;
|
|
100
|
+
build(): this;
|
|
101
|
+
can(action: PermissionActionType, subject: Subjects | S, field?: string): boolean;
|
|
102
|
+
cannot(action: PermissionActionType, subject: Subjects | S, field?: string): boolean;
|
|
103
|
+
setCommonPermissions(user: IUser2): this;
|
|
104
|
+
}
|
|
105
|
+
import { Exception } from "@ooneex/exception";
|
|
106
|
+
declare class PermissionException extends Exception {
|
|
107
|
+
constructor(message: string, data?: Record<string, unknown>);
|
|
108
|
+
}
|
|
109
|
+
export { Subjects, PermissionException, PermissionClassType, PermissionActionType, Permission, IPermission, EPermissionSubject, EPermissionAction };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{AbilityBuilder as h,createMongoAbility as q}from"@casl/ability";import{ERole as w}from"@ooneex/role";import{Exception as f}from"@ooneex/exception";import{HttpStatus as g}from"@ooneex/http-status";class H extends f{constructor(x,k={}){super(x,{status:g.Code.InternalServerError,data:k});this.name="PermissionException"}}class I{ability;builtAbility=null;constructor(){this.ability=new h(q)}allow(x,k,v){return this.ability.can(x,k,v),this}forbid(x,k,v){return this.ability.cannot(x,k,v),this}build(){return this.builtAbility=this.ability.build(),this}can(x,k,v){if(!this.builtAbility)throw new H("Permission must be built before checking abilities");return this.builtAbility.can(x,k,v)}cannot(x,k,v){if(!this.builtAbility)throw new H("Permission must be built before checking abilities");return this.builtAbility.cannot(x,k,v)}setCommonPermissions(x){let{roles:k}=x;if(k.includes(w.SYSTEM)||k.includes(w.SUPER_ADMIN)||k.includes(w.ADMIN))return this.allow("manage","all"),this;for(let v of k){if(v===w.USER||v===w.MEMBER)this.allow(["read","update"],["UserEntity","AuthUserEntity","User","AuthUser"],{id:x.id});if(v===w.SUBSCRIBER)this.allow("read",["UserEntity","AuthUserEntity","User","AuthUser"],{id:x.id});if(v===w.TRIAL_USER)this.allow("read",["User","AuthUser"],{id:x.id});if(v===w.SUSPENDED)this.allow("read",["UserEntity","AuthUserEntity","User","AuthUser"],{id:x.id});if(v===w.GUEST)this.allow("read",["UserEntity","AuthUserEntity","User","AuthUser"],{public:!0})}return this}}var z;((p)=>{p.CREATE="create";p.READ="read";p.UPDATE="update";p.DELETE="delete";p.MANAGE="manage";p.VIEW="view";p.EDIT="edit";p.PUBLISH="publish";p.ARCHIVE="archive";p.APPROVE="approve";p.REJECT="reject";p.DOWNLOAD="download";p.UPLOAD="upload";p.SHARE="share";p.COPY="copy";p.MOVE="move";p.EXPORT="export";p.IMPORT="import";p.EXECUTE="execute";p.ASSIGN="assign";p.UNASSIGN="unassign";p.COMMENT="comment";p.RATE="rate";p.LIKE="like";p.DISLIKE="dislike";p.FOLLOW="follow";p.UNFOLLOW="unfollow";p.SUBSCRIBE="subscribe";p.UNSUBSCRIBE="unsubscribe";p.INVITE="invite";p.REVOKE="revoke";p.GRANT="grant";p.DENY="deny";p.BLOCK="block";p.UNBLOCK="unblock";p.REPORT="report";p.MODERATE="moderate";p.BAN="ban";p.UNBAN="unban";p.RESTORE="restore";p.PURGE="purge";p.BACKUP="backup";p.SYNC="sync";p.CONFIGURE="configure";p.MONITOR="monitor";p.AUDIT="audit";p.SEARCH="search";p.FILTER="filter";p.SORT="sort";p.BOOKMARK="bookmark";p.TAG="tag";p.UNTAG="untag";p.LOCK="lock";p.UNLOCK="unlock";p.CLONE="clone";p.FORK="fork";p.MERGE="merge";p.SPLIT="split";p.VALIDATE="validate";p.VERIFY="verify";p.CANCEL="cancel";p.PAUSE="pause";p.RESUME="resume";p.SCHEDULE="schedule";p.UNSCHEDULE="unschedule";p.JOIN="join";p.HIDE="hide"})(z||={});var D;((C)=>{C.USER_ENTITY="UserEntity";C.AUTH_USER_ENTITY="AuthUserEntity";C.AUTH_USER="AuthUser";C.SYSTEM_ENTITY="SystemEntity";C.SYSTEM="System";C.USER="User";C.ALL="all"})(D||={});export{H as PermissionException,I as Permission,D as EPermissionSubject,z as EPermissionAction};
|
|
2
|
+
|
|
3
|
+
//# debugId=E03E2CB5FC80CB9264756E2164756E21
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["src/Permission.ts", "src/PermissionException.ts", "src/types.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { AbilityBuilder, createMongoAbility, type MongoAbility, type MongoQuery } from \"@casl/ability\";\nimport { ERole } from \"@ooneex/role\";\nimport type { IUser } from \"@ooneex/user\";\nimport { PermissionException } from \"./PermissionException\";\nimport type { PermissionActionType, Subjects } from \"./types\";\n\nexport class Permission<S extends string = string> {\n private ability: AbilityBuilder<MongoAbility>;\n private builtAbility: MongoAbility | null = null;\n\n constructor() {\n this.ability = new AbilityBuilder(createMongoAbility);\n }\n\n public allow(\n action: PermissionActionType | PermissionActionType[],\n subject: (Subjects | S) | (Subjects | S)[],\n conditions?: MongoQuery<Record<string, unknown>>,\n ): this {\n this.ability.can(action as string, subject, conditions);\n return this;\n }\n\n public forbid(\n action: PermissionActionType | PermissionActionType[],\n subject: (Subjects | S) | (Subjects | S)[],\n conditions?: MongoQuery<Record<string, unknown>>,\n ): this {\n this.ability.cannot(action as string, subject, conditions);\n return this;\n }\n\n public build(): this {\n this.builtAbility = this.ability.build();\n return this;\n }\n\n public can(action: PermissionActionType, subject: Subjects | S, field?: string): boolean {\n if (!this.builtAbility) {\n throw new PermissionException(\"Permission must be built before checking abilities\");\n }\n return this.builtAbility.can(action as string, subject as string, field);\n }\n\n public cannot(action: PermissionActionType, subject: Subjects | S, field?: string): boolean {\n if (!this.builtAbility) {\n throw new PermissionException(\"Permission must be built before checking abilities\");\n }\n return this.builtAbility.cannot(action as string, subject as string, field);\n }\n\n public setCommonPermissions(user: IUser): this {\n const { roles } = user;\n\n // Check for highest privilege roles first\n if (roles.includes(ERole.SYSTEM) || roles.includes(ERole.SUPER_ADMIN) || roles.includes(ERole.ADMIN)) {\n this.allow(\"manage\", \"all\");\n return this;\n }\n\n // Apply permissions for each role\n for (const role of roles) {\n if (role === ERole.USER || role === ERole.MEMBER) {\n this.allow([\"read\", \"update\"], [\"UserEntity\", \"AuthUserEntity\", \"User\", \"AuthUser\"], { id: user.id });\n }\n\n if (role === ERole.SUBSCRIBER) {\n this.allow(\"read\", [\"UserEntity\", \"AuthUserEntity\", \"User\", \"AuthUser\"], { id: user.id });\n }\n\n if (role === ERole.TRIAL_USER) {\n this.allow(\"read\", [\"User\", \"AuthUser\"], { id: user.id });\n }\n\n if (role === ERole.SUSPENDED) {\n this.allow(\"read\", [\"UserEntity\", \"AuthUserEntity\", \"User\", \"AuthUser\"], { id: user.id });\n }\n\n if (role === ERole.GUEST) {\n this.allow(\"read\", [\"UserEntity\", \"AuthUserEntity\", \"User\", \"AuthUser\"], { public: true });\n }\n }\n\n return this;\n }\n}\n",
|
|
6
|
+
"import { Exception } from \"@ooneex/exception\";\nimport { HttpStatus } from \"@ooneex/http-status\";\n\nexport class PermissionException extends Exception {\n constructor(message: string, data: Record<string, unknown> = {}) {\n super(message, {\n status: HttpStatus.Code.InternalServerError,\n data,\n });\n this.name = \"PermissionException\";\n }\n}\n",
|
|
7
|
+
"import type { MongoQuery } from \"@casl/ability\";\nimport type { IUser } from \"@ooneex/user\";\n\nexport enum EPermissionAction {\n CREATE = \"create\",\n READ = \"read\",\n UPDATE = \"update\",\n DELETE = \"delete\",\n MANAGE = \"manage\", // Special action that allows everything\n VIEW = \"view\",\n EDIT = \"edit\",\n PUBLISH = \"publish\",\n ARCHIVE = \"archive\",\n APPROVE = \"approve\",\n REJECT = \"reject\",\n DOWNLOAD = \"download\",\n UPLOAD = \"upload\",\n SHARE = \"share\",\n COPY = \"copy\",\n MOVE = \"move\",\n EXPORT = \"export\",\n IMPORT = \"import\",\n EXECUTE = \"execute\",\n ASSIGN = \"assign\",\n UNASSIGN = \"unassign\",\n COMMENT = \"comment\",\n RATE = \"rate\",\n LIKE = \"like\",\n DISLIKE = \"dislike\",\n FOLLOW = \"follow\",\n UNFOLLOW = \"unfollow\",\n SUBSCRIBE = \"subscribe\",\n UNSUBSCRIBE = \"unsubscribe\",\n INVITE = \"invite\",\n REVOKE = \"revoke\",\n GRANT = \"grant\",\n DENY = \"deny\",\n BLOCK = \"block\",\n UNBLOCK = \"unblock\",\n REPORT = \"report\",\n MODERATE = \"moderate\",\n BAN = \"ban\",\n UNBAN = \"unban\",\n RESTORE = \"restore\",\n PURGE = \"purge\",\n BACKUP = \"backup\",\n SYNC = \"sync\",\n CONFIGURE = \"configure\",\n MONITOR = \"monitor\",\n AUDIT = \"audit\",\n SEARCH = \"search\",\n FILTER = \"filter\",\n SORT = \"sort\",\n BOOKMARK = \"bookmark\",\n TAG = \"tag\",\n UNTAG = \"untag\",\n LOCK = \"lock\",\n UNLOCK = \"unlock\",\n CLONE = \"clone\",\n FORK = \"fork\",\n MERGE = \"merge\",\n SPLIT = \"split\",\n VALIDATE = \"validate\",\n VERIFY = \"verify\",\n CANCEL = \"cancel\",\n PAUSE = \"pause\",\n RESUME = \"resume\",\n SCHEDULE = \"schedule\",\n UNSCHEDULE = \"unschedule\",\n JOIN = \"join\",\n HIDE = \"hide\",\n}\n\nexport enum EPermissionSubject {\n USER_ENTITY = \"UserEntity\",\n AUTH_USER_ENTITY = \"AuthUserEntity\",\n AUTH_USER = \"AuthUser\",\n SYSTEM_ENTITY = \"SystemEntity\",\n SYSTEM = \"System\",\n USER = \"User\",\n ALL = \"all\",\n}\n\nexport type PermissionActionType = `${EPermissionAction}`;\nexport type Subjects = `${EPermissionSubject}`;\n\n// biome-ignore lint/suspicious/noExplicitAny: trust me\nexport type PermissionClassType = new (...args: any[]) => IPermission;\n\nexport interface IPermission<S extends string = string> {\n allow: (\n action: PermissionActionType | PermissionActionType[],\n subject: (Subjects | S) | (Subjects | S)[],\n conditions?: MongoQuery<Record<string, unknown>>,\n ) => IPermission<S>;\n forbid: (\n action: PermissionActionType | PermissionActionType[],\n subject: (Subjects | S) | (Subjects | S)[],\n conditions?: MongoQuery<Record<string, unknown>>,\n ) => IPermission<S>;\n build: () => IPermission<S>;\n can: (action: PermissionActionType, subject: Subjects | S, field?: string) => boolean;\n cannot: (action: PermissionActionType, subject: Subjects | S, field?: string) => boolean;\n setCommonPermissions: (user: IUser) => IPermission<S>;\n}\n"
|
|
8
|
+
],
|
|
9
|
+
"mappings": "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",
|
|
10
|
+
"debugId": "E03E2CB5FC80CB9264756E2164756E21",
|
|
11
|
+
"names": []
|
|
12
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ooneex/permission",
|
|
3
|
+
"description": "",
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist",
|
|
8
|
+
"LICENSE",
|
|
9
|
+
"README.md",
|
|
10
|
+
"package.json"
|
|
11
|
+
],
|
|
12
|
+
"module": "./dist/index.js",
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"import": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"default": "./dist/index.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"./package.json": "./package.json"
|
|
22
|
+
},
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"scripts": {
|
|
25
|
+
"test": "bun test tests",
|
|
26
|
+
"build": "bunup",
|
|
27
|
+
"lint": "tsgo --noEmit && bunx biome lint",
|
|
28
|
+
"publish:prod": "bun publish --tolerate-republish --access public",
|
|
29
|
+
"publish:pack": "bun pm pack --destination ./dist",
|
|
30
|
+
"publish:dry": "bun publish --dry-run"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@casl/ability": "^6.7.3",
|
|
34
|
+
"@ooneex/exception": "0.0.1",
|
|
35
|
+
"@ooneex/http-status": "0.0.1",
|
|
36
|
+
"@ooneex/role": "0.0.1"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@ooneex/user": "0.0.1"
|
|
40
|
+
},
|
|
41
|
+
"peerDependencies": {}
|
|
42
|
+
}
|