MaxCompute支持从多种维度查看权限,包括查看指定用户的权限、查看指定角色的权限以及查看指定对象的授权列表。
权限说明
查看用户权限或角色权限时,MaxCompute使用如下标记字符:
- A:表示Allow,即允许访问。
- D:表示Deny,即拒绝访问。
- C:表示With Condition,即为带条件的授权,只出现在Policy授权体系中。
- G:表示With Grant Option,即可以对客体(Object)进行授权。
示例如下。
odps@test_project> show grants for aliyun$odpstest1@aliyun.com;
[roles]
dev
Authorization Type: ACL
[role/dev]
A projects/test_project/tables/t1: Select
[user/odpstest1@aliyun.com]
A projects/test_project: CreateTable | CreateInstance | CreateFunction | List
A projects/test_project/tables/t1: Describe | Select
Authorization Type: Policy
[role/dev]
AC projects/test_project/tables/test_*: Describe
DC projects/test_project/tables/alifinance_*: Select
[user/odpstest1@aliyun.com]
A projects/test_project: Create* | List
AC projects/test_project/tables/alipay_*: Describe | Select
Authorization Type: ObjectCreator
AG projects/test_project/tables/t6: All
AG projects/test_project/tables/t7: All
查看用户的权限
- 查看当前用户自己的访问权限。
show grants;
- 查看云账号用户的访问权限。
show grants for <username>;
例如,查看指定用户云账号bob@aliyun.com在当前项目空间的权限。show grants for ALIYUN$bob@aliyun.com;
- 查看RAM用户权限。
show grants for RAM$主帐号:子帐号;
例如,查看RAM子帐号RAM$bob@aliyun.com:Alice在当前项目空间的权限。show grants for RAM$bob@aliyun.com:Alice;
查看角色的权限
查看指定角色的权限。
describe role <role_name>;
例如查看role_project_admin角色具备的权限。
describe role role_project_admin;
返回结果如下:Role Type: resource
[users]
ALIYUN$xxxxx@test.aliyunid.com
Authorization Type: Policy
A projects/doc_test_dev: *
A projects/doc_test_dev/instances/*: *
A projects/doc_test_dev/jobs/*: *
A projects/doc_test_dev/offlinemodels/*: *
A projects/doc_test_dev/packages/*: *
A projects/doc_test_dev/registration/functions/*: *
A projects/doc_test_dev/resources/*: *
A projects/doc_test_dev/tables/*: *
A projects/doc_test_dev/volumes/*: *
查看对象的授权列表
查看指定对象上的用户和角色授权列表。
show acl for <objectName> [on type <objectType>];
说明 当省略
[on type <objectType>]
时,默认的type为Table。
在文档使用中是否遇到以下问题
更多建议
匿名提交