Skip to content

Commit 1fa4d19

Browse files
Alevskdvaldivia
andauthored
Adding secureComponent to groups and buckets description message (#1243)
Signed-off-by: Lenin Alevski <alevsk.8772@gmail.com> Co-authored-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
1 parent f56b490 commit 1fa4d19

File tree

2 files changed

+41
-24
lines changed

2 files changed

+41
-24
lines changed

portal-ui/src/screens/Console/Buckets/ListBuckets/ListBuckets.tsx

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -382,17 +382,21 @@ const ListBuckets = ({
382382
MinIO uses buckets to organize objects. A bucket is
383383
similar to a folder or directory in a filesystem, where
384384
each bucket can hold an arbitrary number of objects.
385-
<br />
386-
<br />
387-
To get started,&nbsp;
388-
<AButton
389-
onClick={() => {
390-
history.push("/add-bucket");
391-
}}
385+
<SecureComponent
386+
scopes={[IAM_SCOPES.S3_CREATE_BUCKET]}
387+
resource={CONSOLE_UI_RESOURCE}
392388
>
393-
Create a Bucket.
394-
</AButton>
395-
refresh
389+
<br />
390+
<br />
391+
To get started,&nbsp;
392+
<AButton
393+
onClick={() => {
394+
history.push("/add-bucket");
395+
}}
396+
>
397+
Create a Bucket.
398+
</AButton>
399+
</SecureComponent>
396400
</Fragment>
397401
}
398402
/>

portal-ui/src/screens/Console/Groups/Groups.tsx

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,18 @@ const Groups = ({ classes, setErrorSnackMessage }: IGroupsProps) => {
199199

200200
<PageLayout>
201201
<Grid item xs={12} className={classes.actionsTray}>
202-
<SearchBox
203-
placeholder={"Search Groups"}
204-
onChange={setFilter}
205-
classes={classes}
206-
/>
202+
<SecureComponent
203+
resource={CONSOLE_UI_RESOURCE}
204+
scopes={[IAM_SCOPES.ADMIN_LIST_GROUPS]}
205+
errorProps={{ disabled: true }}
206+
>
207+
<SearchBox
208+
placeholder={"Search Groups"}
209+
onChange={setFilter}
210+
classes={classes}
211+
/>
212+
</SecureComponent>
213+
207214
<SecureComponent
208215
resource={CONSOLE_UI_RESOURCE}
209216
scopes={[
@@ -231,14 +238,20 @@ const Groups = ({ classes, setErrorSnackMessage }: IGroupsProps) => {
231238
{records.length > 0 && (
232239
<Fragment>
233240
<Grid item xs={12} className={classes.tableBlock}>
234-
<TableWrapper
235-
itemActions={tableActions}
236-
columns={[{ label: "Name", elementKey: "" }]}
237-
isLoading={loading}
238-
records={filteredRecords}
239-
entityName="Groups"
240-
idField=""
241-
/>
241+
<SecureComponent
242+
resource={CONSOLE_UI_RESOURCE}
243+
scopes={[IAM_SCOPES.ADMIN_LIST_GROUPS]}
244+
errorProps={{ disabled: true }}
245+
>
246+
<TableWrapper
247+
itemActions={tableActions}
248+
columns={[{ label: "Name", elementKey: "" }]}
249+
isLoading={loading}
250+
records={filteredRecords}
251+
entityName="Groups"
252+
idField=""
253+
/>
254+
</SecureComponent>
242255
</Grid>
243256
<Grid item xs={12}>
244257
<HelpBox
@@ -285,7 +298,7 @@ const Groups = ({ classes, setErrorSnackMessage }: IGroupsProps) => {
285298
Groups support more simplified management of user
286299
permissions on the MinIO Tenant.
287300
<SecureComponent
288-
resource="console-ui"
301+
resource={CONSOLE_UI_RESOURCE}
289302
scopes={[
290303
IAM_SCOPES.ADMIN_ADD_USER_TO_GROUP,
291304
IAM_SCOPES.ADMIN_LIST_USERS,

0 commit comments

Comments
 (0)