阿里云oss权限控制

需求:

只对oss目录有上传权限,不能预览,下载,删除

效果:

无法预览:

阿里云oss权限控制_第1张图片

无法下载:

阿里云oss权限控制_第2张图片

无法删除:

阿里云oss权限控制_第3张图片

可以在指定目录上传:

阿里云oss权限控制_第4张图片

策略:

{
    "Version": "1",
    "Statement": [
        {
            "Effect": "Allow",                                #allow代表允许
            "Action": [
                "oss:ListBuckets",
                "oss:GetBucketStat",
                "oss:GetBucketInfo",
                "oss:GetBucketTagging",
                "oss:GetBucketLifecycle",
                "oss:GetBucketWorm",
                "oss:GetBucketVersioning",
                "oss:GetBucketAcl"
            ],
            "Resource": "acs:oss:*:*:*"
        },
        {
            "Effect": "Allow",
            "Action": [
                "oss:ListObjects",
                "oss:GetBucketAcl"
            ],
            "Resource": "acs:oss:*:*:bucket-name"                #bucket-name是你的bucket的名字
        },
        {
            "Effect": "Allow",
            "Action": [
                "oss:ListBuckets",
                "oss:GetBucketStat",
                "oss:GetBucketInfo",
                "oss:GetBucketTagging",
                "oss:GetBucketLifecycle",
                "oss:GetBucketWorm",
                "oss:GetBucketVersioning",
                "oss:GetBucketAcl",
                "oss:PutObject"
            ],
            "Resource": "acs:oss:*:*:bucket-name/oss/*"        #允许查看的目录
        }
    ]
}

你可能感兴趣的:(阿里云,云计算)