How do other users grant my function permissions to access other resources?

Updated at: 2024-02-01 10:08

The following steps show how User A grants a function owned by User B permissions to access the cloud resources of User A:

  1. User A creates a Resource Access Management (RAM) role whose authorized user is user-B@fc.aliyuncs.com. Then, User A specifies the RAM role as the service role.
  2. User B invokes the function and uses context.credentials to assume the role created in Step 1.
  3. User B uses the credentials from this role to access the resources owned by User A.
Note
You may encounter similar scenarios when you use Simple Log Service. For example, you may need to deliver the logs of User A to the Object Storage Service (OSS) bucket of User B.
    Feedback