File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 1
1
import { MODULE_ID } from "../constants.ts" ;
2
2
import { Listener } from "./index.ts" ;
3
3
import { ConvenientEffectsV2 } from "../ui/ce-app/convenient-effects-v2.ts" ;
4
+ import { Settings } from "../settings.ts" ;
4
5
5
6
const UiExtenderInit : Listener = {
6
7
listen ( ) : void {
@@ -13,6 +14,12 @@ const UiExtenderInit: Listener = {
13
14
icon : "fas fa-hand-sparkles" ,
14
15
order : 5 ,
15
16
applicationClass : ConvenientEffectsV2 ,
17
+ predicate : ( ) => {
18
+ const settings = new Settings ( ) ;
19
+ const hasAppPermission =
20
+ game . user . role >= settings . appControlsPermission ;
21
+ return hasAppPermission ;
22
+ } ,
16
23
} ) ;
17
24
} ) ;
18
25
} ,
Original file line number Diff line number Diff line change @@ -232,6 +232,13 @@ declare global {
232
232
* The application of the directory
233
233
*/
234
234
applicationClass : new ( ...args : any [ ] ) => AbstractSidebarTab ;
235
+
236
+ /**
237
+ * The predicate to determine if the directory should be added
238
+ *
239
+ * @returns true if the directory should be added, false otherwise
240
+ */
241
+ predicate ?: ( ) => boolean ;
235
242
}
236
243
237
244
namespace Hooks {
You can’t perform that action at this time.
0 commit comments