Fixes based on test case.
This commit is contained in:
parent
26ee50b10b
commit
a56a228042
|
@ -516,7 +516,7 @@ export function getDBRoleID(roleName: string) {
|
|||
export function getExternalRoleID(roleId: string, version?: string) {
|
||||
// for built-in roles we want to remove the DB role ID element (role_)
|
||||
if (
|
||||
roleId.startsWith(DocumentType.ROLE) &&
|
||||
roleId.startsWith(`${DocumentType.ROLE}${SEPARATOR}`) &&
|
||||
(isBuiltin(roleId) || version === RoleIDVersion.NAME)
|
||||
) {
|
||||
const parts = roleId.split(SEPARATOR)
|
||||
|
|
|
@ -22,6 +22,10 @@ export class RoleAPI extends TestAPI {
|
|||
}
|
||||
|
||||
save = async (body: SaveRoleRequest, expectations?: Expectations) => {
|
||||
// the tests should always be creating the "new" version of roles
|
||||
if (body.version === undefined) {
|
||||
body.version = "name"
|
||||
}
|
||||
return await this._post<SaveRoleResponse>(`/api/roles`, {
|
||||
body,
|
||||
expectations,
|
||||
|
|
Loading…
Reference in New Issue