mirror of
https://github.com/grafana/grafana.git
synced 2025-08-06 20:59:35 +08:00
RBAC: Remove builtin role code (#53767)
* remove rbacBuiltInRoleAssignmentEnabled from frontendsettings * RBAC: Remove RBACBuiltInRoleAssignmentEnabled * RBAC: Remove code for builtin role * RolePicker: Remove unused prop * RolePicker: Rename builtinRole to basicRole * RolePicker: Rename onBuiltinRoleChange to onBasicRoleChange * RolePicker: Rename properties
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import { debounce } from 'lodash';
|
||||
|
||||
import { getBackendSrv } from '@grafana/runtime';
|
||||
import { fetchBuiltinRoles, fetchRoleOptions } from 'app/core/components/RolePicker/api';
|
||||
import { fetchRoleOptions } from 'app/core/components/RolePicker/api';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import store from 'app/core/store';
|
||||
import { AccessControlAction, ServiceAccountDTO, ServiceAccountStateFilter, ThunkResult } from 'app/types';
|
||||
@ -11,7 +11,6 @@ import { API_KEYS_MIGRATION_INFO_STORAGE_KEY } from '../constants';
|
||||
|
||||
import {
|
||||
acOptionsLoaded,
|
||||
builtInRolesLoaded,
|
||||
pageChanged,
|
||||
queryChanged,
|
||||
serviceAccountsFetchBegin,
|
||||
@ -31,14 +30,6 @@ export function fetchACOptions(): ThunkResult<void> {
|
||||
const options = await fetchRoleOptions();
|
||||
dispatch(acOptionsLoaded(options));
|
||||
}
|
||||
if (
|
||||
contextSrv.accessControlBuiltInRoleAssignmentEnabled() &&
|
||||
contextSrv.licensedAccessControlEnabled() &&
|
||||
contextSrv.hasPermission(AccessControlAction.ActionBuiltinRolesList)
|
||||
) {
|
||||
const builtInRoles = await fetchBuiltinRoles();
|
||||
dispatch(builtInRolesLoaded(builtInRoles));
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
|
@ -43,7 +43,6 @@ export const { serviceAccountLoaded, serviceAccountTokensLoaded, serviceAccountF
|
||||
export const initialStateList: ServiceAccountsState = {
|
||||
serviceAccounts: [] as ServiceAccountDTO[],
|
||||
isLoading: true,
|
||||
builtInRoles: {},
|
||||
roleOptions: [],
|
||||
query: '',
|
||||
page: 0,
|
||||
@ -88,9 +87,6 @@ const serviceAccountsSlice = createSlice({
|
||||
acOptionsLoaded: (state, action: PayloadAction<Role[]>): ServiceAccountsState => {
|
||||
return { ...state, roleOptions: action.payload };
|
||||
},
|
||||
builtInRolesLoaded: (state, action: PayloadAction<Record<string, Role[]>>): ServiceAccountsState => {
|
||||
return { ...state, builtInRoles: action.payload };
|
||||
},
|
||||
apiKeysMigrationStatusLoaded: (state, action): ServiceAccountsState => {
|
||||
return { ...state, apiKeysMigrated: action.payload };
|
||||
},
|
||||
@ -121,7 +117,6 @@ export const {
|
||||
serviceAccountsFetchEnd,
|
||||
serviceAccountsFetched,
|
||||
acOptionsLoaded,
|
||||
builtInRolesLoaded,
|
||||
apiKeysMigrationStatusLoaded,
|
||||
showApiKeysMigrationInfoLoaded,
|
||||
pageChanged,
|
||||
|
Reference in New Issue
Block a user