Skip to content

Commit 69c3919

Browse files
Clarify and fix missing permissions on container repo form. (#370) (#371)
(cherry picked from commit 54445f1) Co-authored-by: David Newswanger <dnewswan@redhat.com>
1 parent 60b4118 commit 69c3919

File tree

4 files changed

+20
-8
lines changed

4 files changed

+20
-8
lines changed

src/components/execution-environment/repository-form.tsx

+14-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { Constants } from 'src/constants';
1212

1313
interface IProps {
1414
name: string;
15+
namespace: string;
1516
description: string;
1617
selectedGroups: GroupObjectPermissionType[];
1718
onSave: (string, []) => void;
@@ -34,7 +35,7 @@ export class RepositoryForm extends React.Component<IProps, IState> {
3435
}
3536

3637
render() {
37-
const { name, onSave, onCancel } = this.props;
38+
const { name, onSave, onCancel, namespace } = this.props;
3839
const { description, selectedGroups } = this.state;
3940
return (
4041
<Modal
@@ -59,6 +60,14 @@ export class RepositoryForm extends React.Component<IProps, IState> {
5960
<FormGroup key='name' fieldId='name' label='Name'>
6061
<TextInput id='name' value={name} isDisabled={true} type='text' />
6162
</FormGroup>
63+
<FormGroup key='name' fieldId='name' label='Container namespace'>
64+
<TextInput
65+
id='name'
66+
value={namespace}
67+
isDisabled={true}
68+
type='text'
69+
/>
70+
</FormGroup>
6271
<FormGroup
6372
key='description'
6473
fieldId='description'
@@ -77,6 +86,10 @@ export class RepositoryForm extends React.Component<IProps, IState> {
7786
/>
7887
</FormGroup>
7988
<FormGroup key='groups' fieldId='groups' label='Groups with access'>
89+
<div className='pf-c-form__helper-text'>
90+
Adding groups provides access to all repositories in the "
91+
{namespace}" container namespace.
92+
</div>
8093
<ObjectPermissionField
8194
groups={this.state.selectedGroups}
8295
availablePermissions={Constants.CONTAINER_NAMESPACE_PERMISSIONS}

src/components/permissions/obect-permission-field.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ export class ObjectPermissionField extends React.Component<IProps, IState> {
4747
isDisabled={!!this.props.isDisabled}
4848
/>
4949
<br />
50-
<br />
5150
<div>
5251
{groups.map((group, i) => (
5352
<Flex

src/constants.tsx

+4-5
Original file line numberDiff line numberDiff line change
@@ -124,29 +124,28 @@ export class Constants {
124124
upload_to_namespace: 'Upload to namespace',
125125
add_containernamespace: 'Create new containers',
126126
namespace_pull_containerdistribution: 'Pull private containers',
127-
namespace_change_containerdistribution: 'Change containers',
127+
namespace_change_containerdistribution: 'Update container information',
128128
namespace_view_containerdistribution: 'View private containers',
129129
namespace_modify_content_containerpushrepository: 'Change image tags',
130130
change_containernamespace: 'Change container namespace permissions',
131-
namespace_push_containerdistribution: 'Push to existing containers',
131+
namespace_push_containerdistribution: 'Push images to existing containers',
132132
view_containernamespace: "View container's namespace",
133133
delete_containernamespace: "Delete container's namespace",
134134
namespace_delete_containerdistribution: "Delete container's distribution",
135135
namespace_view_containerpushrepository: "View container's repository",
136-
namespace_add_containerdistribution: 'Add distribution',
136+
namespace_add_containerdistribution: 'Push new containers',
137137
change_containerdistribution: 'Change distribution',
138138
delete_containerdistribution: 'Delete distribution',
139139
push_containerdistribution: 'Push distribution',
140140
pull_containerdistribution: 'Pull distribution',
141141
view_containerdistribution: 'View distribution',
142142
};
143143
static CONTAINER_NAMESPACE_PERMISSIONS = [
144-
'namespace_delete_containerdistribution',
145-
'namespace_view_containerpushrepository',
146144
'change_containernamespace',
147145
'namespace_push_containerdistribution',
148146
'namespace_change_containerdistribution',
149147
'namespace_modify_content_containerpushrepository',
148+
'namespace_add_containerdistribution',
150149
];
151150
static UPSTREAM_HOSTS = [
152151
'galaxy.ansible.com',

src/containers/execution-environment-detail/base.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ export function withContainerRepo(WrappedComponent) {
111111
<Main>
112112
{this.state.editing && (
113113
<RepositoryForm
114-
name={this.props.match.params['container']}
114+
name={this.state.repo.name}
115+
namespace={this.state.repo.namespace.name}
115116
selectedGroups={cloneDeep(this.state.selectedGroups)}
116117
description={this.state.repo.description}
117118
permissions={permissions}

0 commit comments

Comments
 (0)