假设我有一个用户jack
和一个组datateam
。用户jack
属于组datateam
。
使用 Sentry 进行授权。
create role admin;
grant role admin to group datateam;
grant all on server server1 to role admin;
现在该角色admin
具有以下特权。
+-----------+--------+------------+---------+-----------------+-----------------+------------+---------------+-------------------+----------+--+
| database | table | partition | column | principal_name | principal_type | privilege | grant_option | grant_time | grantor |
+-----------+--------+------------+---------+-----------------+-----------------+------------+---------------+-------------------+----------+--+
| * | | | | admin | ROLE | * | false | 1480985013185000 | -- |
+-----------+--------+------------+---------+-----------------+-----------------+------------+---------------+-------------------+----------+--+
假设我有这个数据库。
create database testdb;
这是成功的。用户jack
创建了一个数据库testdb
。
使用 Sentry 撤销testdb
;
revoke all on database `testdb` from role admin;
特权还是一样的。
+-----------+--------+------------+---------+-----------------+-----------------+------------+---------------+-------------------+----------+--+
| database | table | partition | column | principal_name | principal_type | privilege | grant_option | grant_time | grantor |
+-----------+--------+------------+---------+-----------------+-----------------+------------+---------------+-------------------+----------+--+
| * | | | | admin | ROLE | * | false | 1480985013185000 | -- |
+-----------+--------+------------+---------+-----------------+-----------------+------------+---------------+-------------------+----------+--+
Sentry 不应该将数据库的权限testdb
从服务器上拿走server1
吗?