mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 19:10:07 -03:30
Merge pull request #6461 from jakemcdermott/6433-fix-org-team-rbac-save
Don't show user-only roles for teams Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
commit
3bbd03732b
@ -142,6 +142,17 @@ class AddResourceRole extends React.Component {
|
||||
} = this.state;
|
||||
const { onClose, roles, i18n } = this.props;
|
||||
|
||||
// Object roles can be user only, so we remove them when
|
||||
// showing role choices for team access
|
||||
const selectableRoles = { ...roles };
|
||||
if (selectedResource === 'teams') {
|
||||
Object.keys(roles).forEach(key => {
|
||||
if (selectableRoles[key].user_only) {
|
||||
delete selectableRoles[key];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const userSearchColumns = [
|
||||
{
|
||||
name: i18n._(t`Username`),
|
||||
@ -274,7 +285,7 @@ class AddResourceRole extends React.Component {
|
||||
component: (
|
||||
<SelectRoleStep
|
||||
onRolesClick={this.handleRoleCheckboxClick}
|
||||
roles={roles}
|
||||
roles={selectableRoles}
|
||||
selectedListKey={selectedResource === 'users' ? 'username' : 'name'}
|
||||
selectedListLabel={i18n._(t`Selected`)}
|
||||
selectedResourceRows={selectedResourceRows}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user