RBAC: Default to None role on SA creation if accesscontrol enabled (#77035)
* Check accesscontrol enabled on service account creation * fix test * linting
This commit is contained in:
@@ -83,7 +83,7 @@ describe('ServiceAccountCreatePage tests', () => {
|
||||
await waitFor(() =>
|
||||
expect(postMock).toHaveBeenCalledWith('/api/serviceaccounts/', {
|
||||
name: 'Data source scavenger',
|
||||
role: 'None',
|
||||
role: 'Viewer',
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
@@ -29,7 +29,7 @@ export const ServiceAccountCreatePage = ({}: Props): JSX.Element => {
|
||||
const [serviceAccount, setServiceAccount] = useState<ServiceAccountDTO>({
|
||||
id: 0,
|
||||
orgId: contextSrv.user.orgId,
|
||||
role: OrgRole.None,
|
||||
role: contextSrv.licensedAccessControlEnabled() ? OrgRole.None : OrgRole.Viewer,
|
||||
tokens: 0,
|
||||
name: '',
|
||||
login: '',
|
||||
|
||||
Reference in New Issue
Block a user