以下是控制访问整个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
------------以下是控制访问一级目录的代码
{
"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用户无法删除文件,则把删除权限(红底部分)去掉即可