Skip to content

Commit 184f864

Browse files
Alevskdvaldivia
andauthored
Dynamic UI components (#1162)
Hide/Show UI components based on the IAM policy of the current user - Buckets lists: hide/show manage button - Bucket admin page: left menu items enable/disable - Bucket admin page: bucket configuration buttons are enabled/disabled - Bucket admin page: hide/show create buttons - Bucket admin page: enable/disable requests to backend service - Object browser: hide/show bucket buttons for upload, delete, etc - Object browser: hide/show bucket configuration button - Object details: hide/show object buttons, ie: delete - Object details: hide/show object attributes, ie: legal hold, retention, tags, etc Signed-off-by: Lenin Alevski <alevsk.8772@gmail.com> Co-authored-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
1 parent e1a3164 commit 184f864

32 files changed

+1904
-708
lines changed

models/bucket.go

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

models/iam_policy.go

Lines changed: 132 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

models/iam_policy_statement.go

Lines changed: 76 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

models/session_response.go

Lines changed: 48 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/acl/permissions.go

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
// This file is part of MinIO Orchestrator
2+
// Copyright (c) 2021 MinIO, Inc.
3+
//
4+
// This program is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU Affero General Public License as published by
6+
// the Free Software Foundation, either version 3 of the License, or
7+
// (at your option) any later version.
8+
//
9+
// This program is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU Affero General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU Affero General Public License
15+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
17+
package acl
18+
19+
import iampolicy "github.com/minio/pkg/iam/policy"
20+
21+
var BucketViewerRole = iampolicy.NewActionSet(
22+
iampolicy.ListBucketAction,
23+
iampolicy.GetObjectAction,
24+
)
25+
26+
var BucketEditorRole = iampolicy.NewActionSet(
27+
iampolicy.ListBucketAction,
28+
iampolicy.GetObjectAction,
29+
iampolicy.DeleteObjectAction,
30+
iampolicy.PutObjectAction,
31+
)
32+
var BucketAdminRole = iampolicy.NewActionSet(
33+
iampolicy.AbortMultipartUploadAction,
34+
iampolicy.CreateBucketAction,
35+
iampolicy.DeleteBucketAction,
36+
iampolicy.ForceDeleteBucketAction,
37+
iampolicy.DeleteBucketPolicyAction,
38+
iampolicy.GetBucketLocationAction,
39+
iampolicy.GetBucketNotificationAction,
40+
iampolicy.GetBucketPolicyAction,
41+
iampolicy.HeadBucketAction,
42+
iampolicy.ListAllMyBucketsAction,
43+
iampolicy.GetBucketPolicyStatusAction,
44+
iampolicy.ListBucketVersionsAction,
45+
iampolicy.ListBucketMultipartUploadsAction,
46+
iampolicy.ListenNotificationAction,
47+
iampolicy.ListenBucketNotificationAction,
48+
iampolicy.ListMultipartUploadPartsAction,
49+
iampolicy.PutBucketLifecycleAction,
50+
iampolicy.GetBucketLifecycleAction,
51+
iampolicy.PutBucketNotificationAction,
52+
iampolicy.PutBucketPolicyAction,
53+
iampolicy.BypassGovernanceRetentionAction,
54+
iampolicy.PutObjectRetentionAction,
55+
iampolicy.GetObjectRetentionAction,
56+
iampolicy.GetObjectLegalHoldAction,
57+
iampolicy.PutObjectLegalHoldAction,
58+
iampolicy.GetBucketObjectLockConfigurationAction,
59+
iampolicy.PutBucketObjectLockConfigurationAction,
60+
iampolicy.GetBucketTaggingAction,
61+
iampolicy.PutBucketTaggingAction,
62+
iampolicy.GetObjectVersionAction,
63+
iampolicy.GetObjectVersionTaggingAction,
64+
iampolicy.DeleteObjectVersionAction,
65+
iampolicy.DeleteObjectVersionTaggingAction,
66+
iampolicy.PutObjectVersionTaggingAction,
67+
iampolicy.GetObjectTaggingAction,
68+
iampolicy.PutObjectTaggingAction,
69+
iampolicy.DeleteObjectTaggingAction,
70+
iampolicy.PutBucketEncryptionAction,
71+
iampolicy.GetBucketEncryptionAction,
72+
iampolicy.PutBucketVersioningAction,
73+
iampolicy.GetBucketVersioningAction,
74+
iampolicy.GetReplicationConfigurationAction,
75+
iampolicy.PutReplicationConfigurationAction,
76+
iampolicy.ReplicateObjectAction,
77+
iampolicy.ReplicateDeleteAction,
78+
iampolicy.ReplicateTagsAction,
79+
iampolicy.GetObjectVersionForReplicationAction,
80+
iampolicy.AllActions,
81+
)

0 commit comments

Comments
 (0)