@devvit/security 0.11.3-next-2024-11-14-a077c3bb7.0 → 0.11.3-next-2024-11-15-0015b1841.0
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/lib/modPermissions.d.ts +2 -2
- package/lib/modPermissions.js +2 -2
- package/package.json +6 -6
package/lib/modPermissions.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Context, ModeratorPermission } from '@devvit/public-api';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* currentUserHasModPermissions verifies the current user is a mod with all of
|
|
4
4
|
* permissions provided in the `permissions` argument before executing
|
|
5
5
|
* the callback function.
|
|
6
6
|
* @param context Context instance from the request
|
|
@@ -8,7 +8,7 @@ import type { Context, ModeratorPermission } from '@devvit/public-api';
|
|
|
8
8
|
* @param callback Function to execute if the user has the required permissions
|
|
9
9
|
* @returns Promise<void>
|
|
10
10
|
* @throws Error if the user does not have all required permissions
|
|
11
|
-
* @example
|
|
11
|
+
* @example currentUserHasModPermissions(context.reddit, ['all'], () => { ... });
|
|
12
12
|
*/
|
|
13
13
|
export declare function currentUserHasModPermissions(context: Context, permissions: ModeratorPermission[], callback: () => void): Promise<void>;
|
|
14
14
|
//# sourceMappingURL=modPermissions.d.ts.map
|
package/lib/modPermissions.js
CHANGED
|
@@ -11,7 +11,7 @@ async function getPermissions(context) {
|
|
|
11
11
|
: []);
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* currentUserHasModPermissions verifies the current user is a mod with all of
|
|
15
15
|
* permissions provided in the `permissions` argument before executing
|
|
16
16
|
* the callback function.
|
|
17
17
|
* @param context Context instance from the request
|
|
@@ -19,7 +19,7 @@ async function getPermissions(context) {
|
|
|
19
19
|
* @param callback Function to execute if the user has the required permissions
|
|
20
20
|
* @returns Promise<void>
|
|
21
21
|
* @throws Error if the user does not have all required permissions
|
|
22
|
-
* @example
|
|
22
|
+
* @example currentUserHasModPermissions(context.reddit, ['all'], () => { ... });
|
|
23
23
|
*/
|
|
24
24
|
export async function currentUserHasModPermissions(context, permissions, callback) {
|
|
25
25
|
const userPermissionSet = await getPermissions(context);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devvit/security",
|
|
3
|
-
"version": "0.11.3-next-2024-11-
|
|
3
|
+
"version": "0.11.3-next-2024-11-15-0015b1841.0",
|
|
4
4
|
"license": "BSD-3-Clause",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
},
|
|
24
24
|
"types": "./index.d.ts",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@devvit/public-api": "0.11.3-next-2024-11-
|
|
27
|
-
"@devvit/shared-types": "0.11.3-next-2024-11-
|
|
26
|
+
"@devvit/public-api": "0.11.3-next-2024-11-15-0015b1841.0",
|
|
27
|
+
"@devvit/shared-types": "0.11.3-next-2024-11-15-0015b1841.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@devvit/repo-tools": "0.11.3-next-2024-11-
|
|
31
|
-
"@devvit/tsconfig": "0.11.3-next-2024-11-
|
|
30
|
+
"@devvit/repo-tools": "0.11.3-next-2024-11-15-0015b1841.0",
|
|
31
|
+
"@devvit/tsconfig": "0.11.3-next-2024-11-15-0015b1841.0",
|
|
32
32
|
"eslint": "9.11.1",
|
|
33
33
|
"typescript": "5.3.2",
|
|
34
34
|
"vitest": "1.6.0"
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"directory": "dist"
|
|
38
38
|
},
|
|
39
39
|
"source": "./src/index.ts",
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "609aa1b05215a8c89f920ccbca04e663c638acfa"
|
|
41
41
|
}
|