diff options
| author | Chris Lu <chrislusf@users.noreply.github.com> | 2022-01-12 03:09:43 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-12 03:09:43 -0800 |
| commit | ea8e4ec278325841728e4f152f9a0b67e58a55c3 (patch) | |
| tree | 06990bc778b52b6dd5dcb8c10ff9af32fbab5a1a /weed/s3api/auth_credentials_test.go | |
| parent | adfd54e7c4e183ccffb90a3355d9ede898d0eb06 (diff) | |
| parent | edb753ab4d3c49287cfb1ec0f0650aad23977b1c (diff) | |
| download | seaweedfs-ea8e4ec278325841728e4f152f9a0b67e58a55c3.tar.xz seaweedfs-ea8e4ec278325841728e4f152f9a0b67e58a55c3.zip | |
Merge pull request #2584 from kmlebedev/fix_s3_admin_target
Diffstat (limited to 'weed/s3api/auth_credentials_test.go')
| -rw-r--r-- | weed/s3api/auth_credentials_test.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/weed/s3api/auth_credentials_test.go b/weed/s3api/auth_credentials_test.go index 94479b4f5..4545d13bc 100644 --- a/weed/s3api/auth_credentials_test.go +++ b/weed/s3api/auth_credentials_test.go @@ -115,4 +115,14 @@ func TestCanDo(t *testing.T) { assert.Equal(t, true, ident4.canDo(ACTION_READ, "special_bucket", "/a/b/c/d.txt")) assert.Equal(t, false, ident4.canDo(ACTION_READ, "bucket1", "/a/b/c/d.txt")) + // admin buckets + ident5 := &Identity{ + Name: "anything", + Actions: []Action{ + "Admin:special_*", + }, + } + assert.Equal(t, true, ident5.canDo(ACTION_READ, "special_bucket", "/a/b/c/d.txt")) + assert.Equal(t, true, ident5.canDo(ACTION_WRITE, "special_bucket", "/a/b/c/d.txt")) + } |
