Chore: remove hasAccess and hasAcessInMetadata (#76237)

* remove hasAccess and hasAcessInMetadata in favour of hasPermission and hasPermissionInMetadata

* test fixes

* more test fixes
This commit is contained in:
Ieva
2023-10-10 12:04:07 +01:00
committed by GitHub
parent f56cc6fdc0
commit 5e14d93530
23 changed files with 22 additions and 62 deletions

View File

@@ -167,14 +167,6 @@ export class ContextSrv {
return this.hasPermission(AccessControlAction.DataSourcesExplore) && config.exploreEnabled;
}
hasAccess(action: string, fallBack: boolean): boolean {
return this.hasPermission(action);
}
hasAccessInMetadata(action: string, object: WithAccessControlMetadata, fallBack: boolean): boolean {
return this.hasPermissionInMetadata(action, object);
}
// evaluates access control permissions, granting access if the user has any of them
evaluatePermission(actions: string[]) {
if (actions.some((action) => this.hasPermission(action))) {