Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Setting a data base role(Need to set a data base role before executing any SQL)
Setting a data base role [message #694729] Sat, 09 July 2011 13:43 Go to next message
Thomas.K.Hill is currently offline Thomas.K.HillFriend
Messages: 13
Registered: February 2010
Junior Member
Hi,

my data base set-up requires that a data base role is set before any SQL is executed as the login/user receives it's permissions via the role, i.e. a

set role <my role>

is run before any other statement is issued against the data base.


I have found suggestions on the net this could be done in two ways:
1) using a stored procedure
2) using the afterOpen method of a data source.

ad 1) I have tried and found out this doesn't work as the security context will be reset after returning from the stored procedure to same it was prior to the execution of the procedure. So if I am not overlooking something, this doesn't help.

ad 2) I can unfortunatly not figure out (having basically no java scripting skills) how exactly the java script code would need to be looking and haven't found a sufficiently documented example. Can someone please share an example which shows how to do that and the exact syntax to use?

Thanks
Thomas
Re: Setting a data base role [message #695842 is a reply to message #694729] Tue, 12 July 2011 16:24 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

Is the login information used in the query to determine what is available to that person? If you can grab this in the beforeOpen of the dataSet, you can use this in your query to limit the results of the query to only that which the user can see.

Michael

BIRT Evangelist on
http://www.birt-exchange.org


Michael

Developer Evangelist, Silanis
(no subject) [message #695847 is a reply to message #694729] Tue, 12 July 2011 16:24 Go to previous messageGo to next message
Michael is currently offline MichaelFriend
Messages: 43
Registered: July 2009
Member
Is the login information used in the query to determine what is available to that person? If you can grab this in the beforeOpen of the dataSet, you can use this in your query to limit the results of the query to only that which the user can see.

Michael

BIRT Evangelist on
http://www.birt-exchange.org
Re: (no subject) [message #695918 is a reply to message #695847] Tue, 12 July 2011 20:36 Go to previous messageGo to next message
Thomas.K.Hill is currently offline Thomas.K.HillFriend
Messages: 13
Registered: February 2010
Junior Member
yes, usimg the login (CURRENT USER) in the where clause of the SQL is a use case, but even if this would not and in any possible case I need to establish the security context by issuing a 'set role ' command after login but then also prior to ANY SQL executed (e.g. SELECT) as otherwise the SQL command will be rejected by the data base server with a 'no permission' error.
Background: I am granting permissions to roles (e.g. granting select permission on table xy to a role DB_READER) and the individual users which all have their individual data base login are only receiving their permissions by being assigned a role (e.g. by then granting DB_Reader to John, Paul, Mary ...) and not via 'grant select on table xy to John', grant select on table xy to Paul, ....
This however then requires the 'set role ' command to be executed for the user (e.g. John) before the data base would allow him to select data from table xy. Trying to do a select without a previous set role would, as said, not work and lead to a permission error.
Hope this clarifies.
Thanks
Re: (no subject) [message #699702 is a reply to message #695918] Fri, 22 July 2011 06:44 Go to previous messageGo to next message
Thomas.K.Hill is currently offline Thomas.K.HillFriend
Messages: 13
Registered: February 2010
Junior Member
any further thoughts on this would be appreciated!
Trust setting a role is possible and it's just me not knowing how to do it
Thanks
Thomas
Re: (no subject) [message #699937 is a reply to message #699702] Fri, 22 July 2011 14:55 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Thomas


Right now the dataset will only execute one statement. We are looking
at improving it sot it would be good if you logged this in bugzilla.
You could always make a connection of your own in the beforeFactory
event and call it. Have you tried setting a role in a birt dataset?

Jason

On 7/22/2011 2:44 AM, Thomas.K.Hill wrote:
> any further thoughts on this would be appreciated!
> Trust setting a role is possible and it's just me not knowing how to do it
> Thanks
> Thomas
Previous Topic:RCP Birt Designer and Database Server running SSL
Next Topic:APIs error conection
Goto Forum:
  


Current Time: Tue Apr 16 16:18:22 GMT 2024

Powered by FUDForum. Page generated in 0.07342 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top