本文向您介绍如何添加项目角色并通过角色为用户授权。
场景描述
Jack是项目空间prj1的管理员,新加入项目组的成员有Alice、 Bob、Charlie,他们是数据审查员。数据审查员需要申请的权限包括查看Table列表、提交作业、读取表userprofile。
这个场景下的授权,项目空间管理员可以使用基于对象的ACL授权 机制来完成。
操作方法
由项目管理员Jack执行如下命令。
- 进入项目空间prj1。
use prj1;
- 将新用户Alice、 Bob、Charlie加入prj1项目空间中。
add user aliyun$alice@aliyun.com; add user aliyun$bob@aliyun.com; add user aliyun$charlie@aliyun.com;
- 创建角色数据审查员tableviewer。
create role tableviewer;
- 为角色数据审查员tableviewer授权。
grant List, CreateInstance on project prj1 to role tableviewer; grant Describe, Select on table userprofile to role tableviewer;
- 将角色tableviewer授权给用户。
grant tableviewer to aliyun$alice@aliyun.com; grant tableviewer to aliyun$bob@aliyun.com; grant tableviewer to aliyun$charlie@aliyun.com;