mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 06:35:24 +00:00
feat: rebuild workspaces as the reference plugin
This commit is contained in:
1 parent
d774df8b41
commit
f217d8db89
79 files changed
+32995
-2184
No files matched your search
@@ -50,6 +50,12 @@ function load(): Promise<CachedPermissions> {
|
||||
return inFlight;
|
||||
}
|
||||
|
||||
/** The same answer usePermissions().has gives, for code outside a component. */
|
||||
export async function hasPermission(permission: string): Promise<boolean> {
|
||||
const { permissions, isAdmin } = await load();
|
||||
return matchesPermission(permissions, isAdmin, permission);
|
||||
}
|
||||
|
||||
export function notifyPermissionsChanged(): void {
|
||||
cache = null;
|
||||
window.dispatchEvent(new Event(PERMISSIONS_CHANGED_EVENT));
|
||||
|
||||
Reference in new issue
Block a user