以下是控制訪問(wèn)整個(gè)Bucket的代碼
{
"Version": "1",
"Statement": [
{
"Effect": "Allow",
"Action": "oss:ListBuckets",
"Resource": "acs:oss:*:*:*"
},
{
"Effect": "Allow",
"Action": "oss:Listobjects",
"Resource": "acs:oss:*:*:bz-bh"
},
{
"Effect": "Allow",
"Action": "oss:GetObject",
"Resource": "acs:oss:*:*:bz-bh"
}
]
}
bz-bh為Bucket
------------以下是控制訪問(wèn)一級(jí)目錄的代碼
{
"Statement": [
{
"Effect": "Allow",
"Action": "oss:*",
"Resource": "acs:oss:*:*:yiskyxm/ahzl.msz315.com/*"
},
{
"Effect": "Allow",
"Action": "oss:ListObjects",
"Resource": "acs:oss:*:*:yiskyxm",
"Condition": {
"StringLike": {
"oss:Prefix": [
"",
"ahzl.msz315.com/",
"ahzl.msz315.com/*"
]
},
"StringEquals": {
"oss:Delimiter": "/"
}
}
},
{
"Effect": "Allow",
"Action": "oss:ListBuckets",
"Resource": "acs:oss:*:*:*"
}
],
"Version": "1"
}
如果想讓RAM用戶無(wú)法刪除文件,則把刪除權(quán)限(紅底部分)去掉即可