mirror of
https://github.com/minio/minio.git
synced 2025-11-25 20:16:10 -05:00
Add support for multiple admins (#8487)
Also define IAM policies for administering MinIO server
This commit is contained in:
@@ -183,6 +183,14 @@ func TestStatementIsValid(t *testing.T) {
|
||||
t.Fatalf("unexpected error. %v\n", err)
|
||||
}
|
||||
|
||||
func3, err := condition.NewStringEqualsFunc(
|
||||
condition.AWSUserAgent,
|
||||
"NSPlayer",
|
||||
)
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error. %v\n", err)
|
||||
}
|
||||
|
||||
testCases := []struct {
|
||||
statement Statement
|
||||
expectErr bool
|
||||
@@ -233,6 +241,18 @@ func TestStatementIsValid(t *testing.T) {
|
||||
NewResourceSet(NewResource("mybucket", "myobject*")),
|
||||
condition.NewFunctions(func1),
|
||||
), false},
|
||||
{NewStatement(
|
||||
policy.Allow,
|
||||
NewActionSet(CreateUserAdminAction, DeleteUserAdminAction),
|
||||
nil,
|
||||
condition.NewFunctions(func2, func3),
|
||||
), true},
|
||||
{NewStatement(
|
||||
policy.Allow,
|
||||
NewActionSet(CreateUserAdminAction, DeleteUserAdminAction),
|
||||
nil,
|
||||
condition.NewFunctions(),
|
||||
), false},
|
||||
}
|
||||
|
||||
for i, testCase := range testCases {
|
||||
|
||||
Reference in New Issue
Block a user