Merge pull request #9048 from AlexSCorey/8961-AuditorCanAddUserRoles

fixes erroneous render of add button

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
softwarefactory-project-zuul[bot] 2021-01-26 18:48:43 +00:00 committed by GitHub
commit dfa65225d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View File

@ -98,8 +98,7 @@ function UserRolesList({ i18n, user }) {
);
const canAdd =
user?.summary_fields?.user_capabilities?.edit ||
(actions && Object.prototype.hasOwnProperty.call(actions, 'POST'));
actions && Object.prototype.hasOwnProperty.call(actions, 'POST');
const detailUrl = role => {
const { resource_id, resource_type } = role.summary_fields;

View File

@ -12,7 +12,7 @@ jest.mock('../../../api/models/Roles');
UsersAPI.readOptions.mockResolvedValue({
data: {
actions: { GET: {} },
actions: { GET: {}, POST: {} },
related_search_fields: [],
},
});