imhl1
Intern
Intern
  • UID5306
  • Fans0
  • Follows0
  • Posts1
Reads:885Replies:1

[Ask for Help] Custom Policy for OSS

Created#
More Posted time:Mar 10, 2018 17:31 PM
Hi Everyone,
I have created a root folder called A and there are two subfolders under A. The two subfolders name are Alice and Peter respectively. I attach a custom policy to the root folder with the policy below.


{
  "Statement": [
    {
      "Action": [
        "oss:Get*",
        "oss:List*",
        "oss:Put*"
      ],
      "Effect": "Allow",
      "Resource": "acs:oss:*:*:A/${username}/*"
    }
  ],
  "Version": "1"
}

When Alice log in to the console using her credentails and tried to upload a new file into her folder, she is unable to upload the folder.

Does anyone know how to solve this issue or i am using the wrong policy variable?

Thanks in advance.

wanghq
Intern
Intern
  • UID5366
  • Fans0
  • Follows0
  • Posts2
1st Reply#
Posted time:Mar 21, 2018 5:10 AM
As far as I know, variables like ${username} are not supported. So you need to replace that variable with fixed user name and attach different policies to different user. I know this is very inconvenient, though I don't know any other workaround.
Guest