5、授予用户lg3的chief_editor_role角色
grant role chief_editor_role to lg3
6、显示登录用户被授予的角色
sp_displayroles lg3
7、显示角色chief_editor_role包含的所有角色
sp_displayroles chief_editor_role
显示结果为:
role name
---------
author_role
editor_role
7、 查看登录用户lg3被激活的角色及在分层中子级别中的角色
sp_displayroles lg3,expand_down
显示结果:
role name parent role name level
--------- ---------------- -----------
chief_editor_role null 1
author_role chief_editor_role 2
editor_role chief_editor_role 2
author_role editor_role 3
commtentator_role editor_role 3
结论:通过以上实验我们知道,给角色之间增加了分层和互斥功能,使用户授权更加的安全和灵活。
