User Tools

Site Tools


user_his_roles_and_privileges

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
user_his_roles_and_privileges [2018/03/28 15:53]
admin
user_his_roles_and_privileges [2018/03/28 15:54] (current)
admin
Line 29: Line 29:
   start with grantee is null   start with grantee is null
   connect by grantee = prior granted_role;   connect by grantee = prior granted_role;
 +  
 +--# Privileges  
 +  
 +  select * from (
 +  select GRANTEE, OWNER, TABLE_NAME, GRANTOR, PRIVILEGE from dba_tab_privs where lower(grantee)='&username'
 +    union -- # looking up table rights of granted roles
 +  select 'Role: '||ROLE, OWNER, TABLE_NAME,  NULL,PRIVILEGE from ROLE_TAB_PRIVS where role in (select 
 +  GRANTED_ROLE from dba_role_privs where lower(grantee)='&&username')
 +    union -- # looking up table rights of roles granted to GRANTED_ROLE - (2nd level)
 +  select 'Role-Role:'|| ROLE, OWNER, TABLE_NAME,  NULL, PRIVILEGE from ROLE_TAB_PRIVS where role in
 +         (select GRANTED_ROLE from ROLE_ROLE_PRIVS where ROLE in (select GRANTED_ROLE from dba_role_privs 
 +  where lower(GRANTEE)='&&username'))
 +  )order by grantee ;
user_his_roles_and_privileges.1522241585.txt.gz ยท Last modified: 2018/03/28 15:53 by admin