Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesOracle 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:
  #1  
Old October 6th, 2012, 08:33 AM
kappy kappy is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 6 kappy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 41 m 47 sec
Reputation Power: 0
SQL query to grant permission

I want sql querys for following scenarios

Owner of the compant wants to create 5 users,3 in following fashion
1) 2 -Must have authority of admin
2) 2- Normal user
3) 1 - User whose password is blocked for 15 days

Reply With Quote
  #2  
Old October 8th, 2012, 10:10 AM
debasisdas's Avatar
debasisdas debasisdas is offline
Humble Learner
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2007
Location: Bangalore, India
Posts: 279 debasisdas User rank is First Lieutenant (10000 - 20000 Reputation Level)debasisdas User rank is First Lieutenant (10000 - 20000 Reputation Level)debasisdas User rank is First Lieutenant (10000 - 20000 Reputation Level)debasisdas User rank is First Lieutenant (10000 - 20000 Reputation Level)debasisdas User rank is First Lieutenant (10000 - 20000 Reputation Level)debasisdas User rank is First Lieutenant (10000 - 20000 Reputation Level)debasisdas User rank is First Lieutenant (10000 - 20000 Reputation Level)debasisdas User rank is First Lieutenant (10000 - 20000 Reputation Level)  Folding Points: 1142847 Folding Title: Super Ultimate Folder - Level 3Folding Points: 1142847 Folding Title: Super Ultimate Folder - Level 3Folding Points: 1142847 Folding Title: Super Ultimate Folder - Level 3Folding Points: 1142847 Folding Title: Super Ultimate Folder - Level 3Folding Points: 1142847 Folding Title: Super Ultimate Folder - Level 3Folding Points: 1142847 Folding Title: Super Ultimate Folder - Level 3Folding Points: 1142847 Folding Title: Super Ultimate Folder - Level 3Folding Points: 1142847 Folding Title: Super Ultimate Folder - Level 3
Time spent in forums: 2 Months 3 Days 4 h 48 m 5 sec
Reputation Power: 118
Send a message via ICQ to debasisdas Send a message via AIM to debasisdas Send a message via MSN to debasisdas Send a message via Yahoo to debasisdas Send a message via Google Talk to debasisdas Send a message via Skype to debasisdas
What kind of users you are talking about ?

Reply With Quote
  #3  
Old October 8th, 2012, 01:40 PM
kappy kappy is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 6 kappy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 41 m 47 sec
Reputation Power: 0
Quote:
Originally Posted by debasisdas
What kind of users you are talking about ?


Administrator
Normal User
Normal User whose account is blocked for 15 days
any scenario you can consider
Example -:College database
Teacher has right to upddate and delete marks and many other right like admin
student can only log in and can see results and raise objection.

Reply With Quote
  #4  
Old October 8th, 2012, 05:57 PM
clivew clivew is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2006
Location: Carlsbad, CA
Posts: 2,045 clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 2 h 37 m
Reputation Power: 382
I believe what debasisdas is asking (as I would) about kind of user is:
e.g.
Windows user
or
Database user
or
Application user
or
???
Comments on this post
debasisdas agrees: Yes, that is exactly what i was asking.

Reply With Quote
  #5  
Old October 8th, 2012, 10:13 PM
kappy kappy is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 6 kappy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 41 m 47 sec
Reputation Power: 0
Quote:
Originally Posted by clivew
I believe what debasisdas is asking (as I would) about kind of user is:
e.g.
Windows user
or
Database user
or
Application user
or
???


Its application user

Reply With Quote
  #6  
Old October 9th, 2012, 04:02 PM
clivew clivew is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2006
Location: Carlsbad, CA
Posts: 2,045 clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 2 h 37 m
Reputation Power: 382
Quote:
Its application user

Then you just need a column in your APP_USERS table for user type.
Also, from a schema design perspective, you should have a USER_TYPES table.

USER_TYPES fields
USER_TYPE_ID INTEGER PK,
USER_TYPE_DESCRIPTION VARCHAR2(100)

APP_USERS or whatever you have called it
All your current fields
USER_TYPE_ID INTEGER FK to USER_TYPES

Now you simply add the USER_TYPE_ID field to your SQL and use an if..then or case statement in your
application code to determine what the user can do.

Edit
-----
I forgot, you will also need a DATE_ADDED field if you need to deal with 15 day time periods.
Clive

Last edited by clivew : October 9th, 2012 at 07:47 PM. Reason: Added column for handling elapsed time.

Reply With Quote
  #7  
Old October 10th, 2012, 03:33 AM
kappy kappy is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 6 kappy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 41 m 47 sec
Reputation Power: 0
Quote:
Originally Posted by clivew
Then you just need a column in your APP_USERS table for user type.
Also, from a schema design perspective, you should have a USER_TYPES table.

USER_TYPES fields
USER_TYPE_ID INTEGER PK,
USER_TYPE_DESCRIPTION VARCHAR2(100)

APP_USERS or whatever you have called it
All your current fields
USER_TYPE_ID INTEGER FK to USER_TYPES

Now you simply add the USER_TYPE_ID field to your SQL and use an if..then or case statement in your
application code to determine what the user can do.

Edit
-----
I forgot, you will also need a DATE_ADDED field if you need to deal with 15 day time periods.
Clive



Thanks

Reply With Quote
  #8  
Old October 10th, 2012, 03:37 AM
kappy kappy is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 6 kappy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 41 m 47 sec
Reputation Power: 0
Quote:
Originally Posted by kappy
Thanks


What if its database user? Do I need to use grant command to assign rights.

Reply With Quote
  #9  
Old October 10th, 2012, 01:43 PM
clivew clivew is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2006
Location: Carlsbad, CA
Posts: 2,045 clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 2 h 37 m
Reputation Power: 382
Quote:
What if its database user? Do I need to use grant command to assign rights.

For any normal user, of course.
You will have to consult the documentation (or other responses here) for the specifics of any super users
like schema owners, administrators etc.

Clive

Reply With Quote
  #10  
Old October 11th, 2012, 03:04 AM
kappy kappy is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 6 kappy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 41 m 47 sec
Reputation Power: 0
Quote:
Originally Posted by clivew
For any normal user, of course.
You will have to consult the documentation (or other responses here) for the specifics of any super users
like schema owners, administrators etc.

Clive


with your reply.
Can you elaborate in simple words?

Reply With Quote
  #11  
Old October 11th, 2012, 03:51 PM
clivew clivew is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2006
Location: Carlsbad, CA
Posts: 2,045 clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 2 h 37 m
Reputation Power: 382
Quote:
Can you elaborate in simple words?

I will try
However, it looks as if you could benefit from reading some of the Oracle documentation on users and grants.

(all subject to being corrected as I am going from memory)
BASIC
Any user who creates an object (TABLE, PROCEDURE, VIEW, SEQUENCE etc.) is the
only user who can access that object unless that user GRANTS permission to other users by name or to PUBLIC.
Permissions can also be granular. e.g. You could grant someone SELECT and UPDATE permission on a table but not INSERT and DELETE.

As I understand it, there are also certain super users like DBA and system manager who have rights over everything whether they created it or not.

There is a lot more to the whole subject.
Lots of rules I have not mentioned and things I have mentioned that probably have all sorts of additional variants.

For your purposes it is probably sufficient to know that you have to grant permission of some sort on objects you create for any other regular user to be able to access them.

Clive

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > SQL query to grant permission

Developer Shed Advertisers and Affiliates



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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap