mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-10-12 23:37:00 +08:00
37 lines
766 B
TypeScript
37 lines
766 B
TypeScript
/*
|
|
* CloudBeaver - Cloud Database Manager
|
|
* Copyright (C) 2020-2021 DBeaver Corp and others
|
|
*
|
|
* Licensed under the Apache License, Version 2.0.
|
|
* you may not use this file except in compliance with the License.
|
|
*/
|
|
|
|
import { injectable } from '@cloudbeaver/core-di';
|
|
|
|
import { PermissionsResource } from './PermissionsResource';
|
|
|
|
export enum EPermission {
|
|
public = 'public'
|
|
}
|
|
|
|
@injectable()
|
|
export class PermissionsService {
|
|
constructor(
|
|
private permissions: PermissionsResource
|
|
) {
|
|
}
|
|
|
|
has(id: string): boolean {
|
|
return this.permissions.has(id);
|
|
}
|
|
|
|
async hasAsync(id: string): Promise<boolean> {
|
|
await this.permissions.load();
|
|
return this.has(id);
|
|
}
|
|
|
|
async update(): Promise<void> {
|
|
await this.permissions.refresh();
|
|
}
|
|
}
|