Home » RDBMS Server » Security » roles and users
roles and users [message #8988] |
Thu, 09 October 2003 03:56  |
Deepa
Messages: 269 Registered: November 2000
|
Senior Member |
|
|
Hi,
I have created a public synonym for a role and granted prvileges for that synonym to some users.When the user access the data suddenly the role gets revoked from the user.can u explain me how this happens?
Thanks and regards,
Deepa
|
|
|
|
|
Re: roles and users [message #9003 is a reply to message #9002] |
Fri, 10 October 2003 04:24  |
Thiru
Messages: 1089 Registered: May 2002
|
Senior Member |
|
|
Deepa,
Does the application dynamically set the role using DBMS_SESSION.SET_ROLE procedure or SET ROLE sql command based on the user credentials ? It may be that you have granted the role to the user,but the application disables it on the fly for that session.
Did you create a synonym for the package ? Can you reproduce this in sqlPlus ?
Also note that roles are disabled within packages.
Again,how are you confirming that the role has been revoked? did you check it with user_role_privs and session_roles?
Lets see how this can happen :
thiru@9.2.0:SQL>show user
USER is "THIRU"
thiru@9.2.0:SQL>create or replace package my_pkg as
2 procedure test_proc;
3 end;
4 /
Package created.
thiru@9.2.0:SQL>create or replace package body my_pkg as
2 procedure test_proc is
3 begin
4 null;
5 end test_proc;
6 end my_pkg;
7 /
Package body created.
thiru@9.2.0:SQL>create role test_role;
Role created.
thiru@9.2.0:SQL>grant execute on my_pkg to test_role;
Grant succeeded.
thiru@9.2.0:SQL>drop public synonym my_pkg;
Synonym dropped.
thiru@9.2.0:SQL>create public synonym my_pkg for my_pkg;
Synonym created.
thiru@9.2.0:SQL>grant test_role to test;
Grant succeeded.
thiru@9.2.0:SQL>connect test/test
Connected.
thiru@9.2.0:SQL>select * from user_role_privs;
USERNAME GRANTED_ROLE ADM DEF OS_
--------------- ------------------------------ --- --- ---
TEST CONNECT NO YES NO
TEST MY_ROLE NO YES NO
TEST TEST_ROLE NO YES NO
thiru@9.2.0:SQL>execute my_pkg.test_proc;
PL/SQL procedure successfully completed.
-- Lets dynamically change the session role to CONNECT only.
thiru@9.2.0:SQL>set role connect;
Role set.
thiru@9.2.0:SQL>execute my_pkg.test_proc;
BEGIN my_pkg.test_proc; END;
*
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00201: identifier 'MY_PKG' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
-- Since the test_role was disabled within the app,you couldnt see the package
thiru@9.2.0:SQL>select * from session_roles;
ROLE
------------------------------
CONNECT
-- Lets enable TEST_ROLE
thiru@9.2.0:SQL>set role test_role;
Role set.
thiru@9.2.0:SQL>execute my_pkg.test_proc;
PL/SQL procedure successfully completed.
|
|
|
Goto Forum:
Current Time: Thu May 01 09:12:32 CDT 2025
|