Firebird SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesFirebird SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today!
  #1  
Old September 15th, 2006, 02:34 AM
nagysz nagysz is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2006
Posts: 46 nagysz User rank is Corporal (100 - 500 Reputation Level)nagysz User rank is Corporal (100 - 500 Reputation Level)nagysz User rank is Corporal (100 - 500 Reputation Level)nagysz User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 10 h 4 m 43 sec
Reputation Power: 4
Question Roles and Users

Hi folks,

this roles and users and organizing thingy gives me a pretty bad headache lately. I'm new to firebird yet, am trying and like it but have many difficulties yet.

see my example please:

i have a CLIENTS table, and an ORDERS table.
there is a role CLIENT_OP who is responsible for the clients' data, he is allowed to update/delete/insert the CLIENT table.
the OPDERS_OP role has full rights to the ORDERS table and select right to the CLIENTS table. till this point it's okay.

but i want some higher skilled users to be able to do both operations..editing the clients table and also making orders.

how can i tell firebird that this user uses 2 roles?

actually...when i give 2 roles to a user do the rights substract or unify? will i have access to both tables or to none?



Sly

Reply With Quote
  #2  
Old September 15th, 2006, 06:53 PM
clivew clivew is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2006
Location: Carlsbad, CA
Posts: 681 clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Days 14 h 23 m 2 sec
Reputation Power: 12
Quote:
Originally Posted by nagysz
how can i tell firebird that this user uses 2 roles?

actually...when i give 2 roles to a user do the rights substract or unify? will i have access to both tables or to none?
Sly


You can give a user as many roles as you like. Each role has whatever privileges you assign to it.

However, a user can only log in using a SINGLE role.

Therefore, you will have to create a third role (ADMIN or SUPER etc.) and grant that role all the privileges of both roles.

Unlike some other databases (Oracle comes to mind) you actually have to log on WITH the role you want to get the privileges of that role. Firebird does not lookup all the roles granted to a user and set the privileges from that lookup.

Clive.
Comments on this post
pabloj agrees!

Reply With Quote
  #3  
Old September 17th, 2006, 10:57 AM
nagysz nagysz is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2006
Posts: 46 nagysz User rank is Corporal (100 - 500 Reputation Level)nagysz User rank is Corporal (100 - 500 Reputation Level)nagysz User rank is Corporal (100 - 500 Reputation Level)nagysz User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 10 h 4 m 43 sec
Reputation Power: 4
I understand. I managed to give multiple roles to the user.

Is there a more convenient way to access multiple role rights? Because in a very complex system i will have very many roles (everybody may access the data that he works on and nothing else) but if i have some users that should do more people's work then i should create these kind of ADMIN1, ADMIN2, ... roles with all the desired combinations....or...find a more convenient and still secure way.

When simply editing tables i could do something like...the program will query what roles have Udpate/etc... access to that table and check for if the user is associated with any of the righty roles then quickly disconnect and connect with the right role...

But at more complicated tasks, when editing multiple tables in the same time this way is not gonna work.


Is there a possibility to inherit the rights from a role?
Something like create ROLE3 inherit all rights from ROLE2 and ROLE1?

Reply With Quote
  #4  
Old April 22nd, 2008, 06:42 AM
dirinler dirinler is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 13 dirinler User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 21 m 25 sec
Reputation Power: 0
you can give to users roles etc
you need to use these commands grant revoke

and i think the developers will create this option with version 3.0

Reply With Quote
  #5  
Old April 22nd, 2008, 06:53 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,620 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 2 Weeks 3 Days 23 h 47 m 19 sec
Reputation Power: 259
Quote:
Originally Posted by dirinler
...
and i think the developers will create this option with version 3.0
Actually in 2.5, first snapshot is available right now

Reply With Quote
  #6  
Old April 22nd, 2008, 08:40 AM
dirinler dirinler is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 13 dirinler User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 21 m 25 sec
Reputation Power: 0
good news thanks pabloj whats the firebirds lastest version avaible now?2.0.3 or ?

Reply With Quote
  #7  
Old April 22nd, 2008, 08:57 AM
shammat shammat is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2003
Location: Munich, Bavaria
Posts: 960 shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 13 h 45 m 57 sec
Reputation Power: 57
Quote:
Originally Posted by clivew
Unlike some other databases (Oracle comes to mind) you actually have to log on WITH the role you want to get the privileges of that role.
A bit off-topic, but you can grant roles in Oracle in such a way that the user has to enable them manually. You can even "secure" the role with a password that the user needs to enter when he/she tries to activate the role.

Reply With Quote
  #8  
Old April 22nd, 2008, 09:38 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,620 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 2 Weeks 3 Days 23 h 47 m 19 sec
Reputation Power: 259
Quote:
Originally Posted by dirinler
good news thanks pabloj whats the firebirds lastest version avaible now?2.0.3 or ?
Afaik 2.1 has just been released as stable

Reply With Quote
  #9  
Old June 29th, 2008, 10:33 AM
Firebirdy Firebirdy is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2008
Posts: 2 Firebirdy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 39 m 40 sec
Reputation Power: 0
Question Firebird roles

Hi everyone

Thanks for the informative thread. I've a question on firebird. (I'm curently using V 2.0 something with PHP 5 and ADO for PHP).

I have three roles:-

A Admin
B Booker
C Viewer

Admin has the abiliy to do anything.
Booker has the ability to insert and update and delete specific subsets of a table bookings.
Viewer can only look at bookings.

As I understand it the users connect with their usernames and passwords and the role.

What is to stop a Viewer (or Booker) user connecting with their valid username and password but with a role of admin ?

An explanation or 'gotchas' would be very much appreciated before I write loads of grants and revokes etc. on loads more tables.

Thanks very much

Firebirdy

Reply With Quote
  #10  
Old June 29th, 2008, 11:52 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,620 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 2 Weeks 3 Days 23 h 47 m 19 sec
Reputation Power: 259
Quote:
Originally Posted by Firebirdy
...
What is to stop a Viewer (or Booker) user connecting with their valid username and password but with a role of admin ?
...
I don't understand your questions, you created 3 roles and granted them to users (selectively), now, a use who hasn't been granted a role can't connecto with that role, simple as this.
Of course if you granted full rights to public no role will help, first revoke everything from public and then give appropriate grants.

Reply With Quote
  #11  
Old June 29th, 2008, 12:04 PM
Firebirdy Firebirdy is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2008
Posts: 2 Firebirdy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 39 m 40 sec
Reputation Power: 0
Quote:
Originally Posted by pabloj
I don't understand your questions, you created 3 roles and granted them to users (selectively), now, a use who hasn't been granted a role can't connecto with that role, simple as this.
Of course if you granted full rights to public no role will help, first revoke everything from public and then give appropriate grants.


Thanks. That answers my question. I was worried that a valid user with just the rights as a Viewer only coluld log on using their valid Viewer username and password but specify the role of 'Admin' when logging in.

You also pointed out the gotcha of the fact we must remember to ensure no public rights.

Thanks once again for your speed reply.

Firebirdy

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > Roles and Users


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

IBM developerWorks