SlideShare a Scribd company logo
SQL Authorization Privileges Grant and Revoke Grant Diagrams
Authorization A file system identifies certain privileges on the objects (files) it manages. Typically read, write, execute. A file system identifies certain participants to whom privileges may be granted. Typically the owner, a group, all users.
Objectives How to authorize objects in database?
Content Privileges Grant and Revoke Grant Diagrams
Privileges – (1) SQL identifies a more detailed set of privileges on objects (relations) than the typical file system. Nine privileges in all, some of which can be restricted to one column of one relation.
Privileges – (2) Some important privileges on a relation: SELECT  = right to query the relation. INSERT  = right to insert tuples. May apply to only one attribute. DELETE  = right to delete tuples. UPDATE  = right to update tuples. May apply to only one attribute.
Example : Privileges For the statement below: INSERT INTO Beers(name) SELECT beer FROM Sells WHERE NOT EXISTS (SELECT * FROM Beers   WHERE name = beer); We require privileges SELECT on Sells and Beers, and INSERT on Beers or Beers.name. beers that do not appear in Beers.  We add them to Beers with a NULL manufacturer.
Database Objects The objects on which privileges exist include stored tables and views. Other privileges are the right to create objects of a type, e.g., triggers. Views form an important tool for access control.
Example : Views as Access Control We might not want to give the SELECT privilege on  Emps(name, addr, salary) . But it is safer to give SELECT on: CREATE VIEW SafeEmps AS SELECT name, addr FROM Emps; Queries on SafeEmps do not require SELECT on Emps, just on SafeEmps.
Authorization ID’s A user is referred to by  authorization   ID , typically their login name. There is an authorization ID PUBLIC. Granting a privilege to PUBLIC makes it available to any authorization ID.
Granting Privileges You have all possible privileges on the objects, such as relations, that you create. You may grant privileges to other users (authorization ID’s), including PUBLIC. You may also grant privileges WITH GRANT OPTION, which lets the grantee also grant this privilege.
The GRANT Statement To grant privileges, say: GRANT <list of privileges> ON <relation or other object> TO <list of authorization ID’s>; If you want the recipient(s) to be able to pass the privilege(s) to others add: WITH GRANT OPTION
Example : GRANT Suppose you are the owner of Sells.  You may say: GRANT SELECT, UPDATE(price) ON Sells TO sally; Now Sally has the right to issue any query on Sells and can update the price component only.
Example : Grant Option Suppose we also grant: GRANT UPDATE ON Sells TO sally WITH GRANT OPTION; Now, Sally not only can update any attribute of Sells, but can grant to others the privilege UPDATE ON Sells. Also, she can grant more specific privileges like  UPDATE(price)ON Sells .
Revoking Privileges REVOKE <list of privileges> ON <relation or other object> FROM <list of authorization ID’s>; Your grant of these privileges can no longer be used by these users to justify their use of the privilege. But they may still have the privilege because they obtained it independently from elsewhere.
REVOKE Options We must append to the REVOKE statement either: CASCADE .  Now, any grants made by a revokee are also not in force, no matter how far the privilege was passed. RESTRICT .  If the privilege has been passed to others, the REVOKE fails as a warning that something else must be done to “chase the privilege down.”
Grant Diagrams Nodes = user/privilege/grant option?/is owner? UPDATE ON R, UPDATE(a) on R, and UPDATE(b) ON R live in different nodes. SELECT ON R and SELECT ON R WITH GRANT OPTION live in different nodes. Edge  X  -> Y   means that node  X  was used to grant  Y .
Notation for Nodes Use  AP  for the node representing authorization ID  A   having privilege  P . P  * = privilege  P   with grant option. P  ** = the source of the privilege  P . I.e.,  A   is the owner of the object on which  P   is a privilege. Note ** implies grant option.
Manipulating Edges – (1) When  A  grants  P   to  B , We draw an edge from  AP  * or  AP  ** to  BP . Or to  BP  * if the grant is with grant option. If  A  grants a subprivilege  Q   of  P   [say UPDATE(a) on R when  P  is UPDATE ON R] then the edge goes to  BQ   or  BQ  *, instead.
Manipulating Edges – (2) Fundamental rule : User  C   has privilege  Q   as long as there is a path from  XP  ** to  CQ ,  CQ  *, or  CQ  **, and  P   is a superprivilege of  Q . Remember that  P   could be  Q , and  X  could be  C .
Manipulating Edges – (3) If  A  revokes  P   from  B  with the CASCADE option, delete the edge from  AP   to  BP . But if  A   uses RESTRICT instead, and there is an edge from  BP   to anywhere, then reject the revocation and make no change to the graph.
Manipulating Edges – (4) Having revised the edges, we must check that each node has a path from some ** node, representing ownership. Any node with no such path represents a revoked privilege and is deleted from the diagram.
Example : Grant Diagram AP** A owns the object on which P is a privilege BP* A: GRANT P TO B WITH GRANT OPTION CP* B: GRANT P TO C WITH GRANT OPTION CP A: GRANT P TO C
Example : Grant Diagram AP** BP* CP* CP A executes REVOKE P FROM B CASCADE; However, C still has P without grant option because of the direct grant. Not only does B lose P*, but C loses P*. Delete BP* and CP*. Even had C passed P to B, both nodes are still cut off.
 
 
Summary Privileges Grant and Revoke Grant Diagrams

More Related Content

PPT
File models and file accessing models
PDF
Deadlock Avoidance - OS
PPT
Chapter 11 - File System Implementation
PPT
Data modeling using the entity relationship model
PPT
Lecture 6 -_presentation_layer
PPT
Database Chapter 3
PPT
Entity Relationship Diagram
PDF
Multithreading
File models and file accessing models
Deadlock Avoidance - OS
Chapter 11 - File System Implementation
Data modeling using the entity relationship model
Lecture 6 -_presentation_layer
Database Chapter 3
Entity Relationship Diagram
Multithreading

What's hot (20)

PDF
Enhanced Entity-Relationship (EER) Modeling
PPTX
View of data DBMS
PPTX
Database security
PPTX
Database user and administrator.pptx
ODP
ER Model in DBMS
PPTX
Introduction to database
PDF
Distance Vector Multicast Routing Protocol (DVMRP) : Presentation
PPTX
File system vs DBMS
PPTX
DBMS Integrity rule
PPTX
Types and Functions of DDBMS
PPTX
Three main Architectures For Parallel Database.pptx
PPTX
physical file system in operating system
PPTX
File Management in Operating System
PPTX
Distributed web based systems
PPTX
Client server architecture
PPT
Joins in SQL
PPTX
Relational Database Design
PPTX
Spatial Database
PPT
Mutual exclusion and sync
DOCX
VIRTUALIZATION STRUCTURES TOOLS.docx
Enhanced Entity-Relationship (EER) Modeling
View of data DBMS
Database security
Database user and administrator.pptx
ER Model in DBMS
Introduction to database
Distance Vector Multicast Routing Protocol (DVMRP) : Presentation
File system vs DBMS
DBMS Integrity rule
Types and Functions of DDBMS
Three main Architectures For Parallel Database.pptx
physical file system in operating system
File Management in Operating System
Distributed web based systems
Client server architecture
Joins in SQL
Relational Database Design
Spatial Database
Mutual exclusion and sync
VIRTUALIZATION STRUCTURES TOOLS.docx
Ad

Viewers also liked (11)

PPT
6. Integrity and Security in DBMS
PPT
11. Storage and File Structure in DBMS
ODP
Relational keys
PPTX
Slide 5 keys
PPTX
DBMS Keys
PPT
2. Entity Relationship Model in DBMS
PPT
12. Indexing and Hashing in DBMS
PPT
15. Transactions in DBMS
PPT
DBMS - Normalization
6. Integrity and Security in DBMS
11. Storage and File Structure in DBMS
Relational keys
Slide 5 keys
DBMS Keys
2. Entity Relationship Model in DBMS
12. Indexing and Hashing in DBMS
15. Transactions in DBMS
DBMS - Normalization
Ad

Similar to Sql Authorization (18)

PPT
PDF
Trigger in DBMS
PPT
UNIT-1-Security.ppt
PPT
PPT
8034.ppt
PPTX
Discretionary access control(database).pptx
PDF
Chapter 6 Database Security and Authorization (4).pdf
PPT
PPT
e computer notes - Controlling user access
PDF
Security in ORACLE RDBMS
PPTX
User Information in Oracle introduction.pptx
PDF
Sql ch 15 - sql security
PPTX
Clase 18 privilegios modificada
PPTX
Clase 18 privilegios modificada
PPTX
Security in Relational model
PPT
Chapter23
PPT
Les14[1]Controlling User Access
PDF
Lecture Notes Unit4 Chapter13 users , roles and privileges
Trigger in DBMS
UNIT-1-Security.ppt
8034.ppt
Discretionary access control(database).pptx
Chapter 6 Database Security and Authorization (4).pdf
e computer notes - Controlling user access
Security in ORACLE RDBMS
User Information in Oracle introduction.pptx
Sql ch 15 - sql security
Clase 18 privilegios modificada
Clase 18 privilegios modificada
Security in Relational model
Chapter23
Les14[1]Controlling User Access
Lecture Notes Unit4 Chapter13 users , roles and privileges

Recently uploaded (20)

PPTX
master seminar digital applications in india
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Insiders guide to clinical Medicine.pdf
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
Computing-Curriculum for Schools in Ghana
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
Lesson notes of climatology university.
PDF
Pre independence Education in Inndia.pdf
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
RMMM.pdf make it easy to upload and study
PDF
TR - Agricultural Crops Production NC III.pdf
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
Institutional Correction lecture only . . .
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPTX
PPH.pptx obstetrics and gynecology in nursing
master seminar digital applications in india
human mycosis Human fungal infections are called human mycosis..pptx
Insiders guide to clinical Medicine.pdf
Renaissance Architecture: A Journey from Faith to Humanism
Computing-Curriculum for Schools in Ghana
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Lesson notes of climatology university.
Pre independence Education in Inndia.pdf
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
RMMM.pdf make it easy to upload and study
TR - Agricultural Crops Production NC III.pdf
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Supply Chain Operations Speaking Notes -ICLT Program
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Institutional Correction lecture only . . .
Microbial diseases, their pathogenesis and prophylaxis
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPH.pptx obstetrics and gynecology in nursing

Sql Authorization

  • 1. SQL Authorization Privileges Grant and Revoke Grant Diagrams
  • 2. Authorization A file system identifies certain privileges on the objects (files) it manages. Typically read, write, execute. A file system identifies certain participants to whom privileges may be granted. Typically the owner, a group, all users.
  • 3. Objectives How to authorize objects in database?
  • 4. Content Privileges Grant and Revoke Grant Diagrams
  • 5. Privileges – (1) SQL identifies a more detailed set of privileges on objects (relations) than the typical file system. Nine privileges in all, some of which can be restricted to one column of one relation.
  • 6. Privileges – (2) Some important privileges on a relation: SELECT = right to query the relation. INSERT = right to insert tuples. May apply to only one attribute. DELETE = right to delete tuples. UPDATE = right to update tuples. May apply to only one attribute.
  • 7. Example : Privileges For the statement below: INSERT INTO Beers(name) SELECT beer FROM Sells WHERE NOT EXISTS (SELECT * FROM Beers WHERE name = beer); We require privileges SELECT on Sells and Beers, and INSERT on Beers or Beers.name. beers that do not appear in Beers. We add them to Beers with a NULL manufacturer.
  • 8. Database Objects The objects on which privileges exist include stored tables and views. Other privileges are the right to create objects of a type, e.g., triggers. Views form an important tool for access control.
  • 9. Example : Views as Access Control We might not want to give the SELECT privilege on Emps(name, addr, salary) . But it is safer to give SELECT on: CREATE VIEW SafeEmps AS SELECT name, addr FROM Emps; Queries on SafeEmps do not require SELECT on Emps, just on SafeEmps.
  • 10. Authorization ID’s A user is referred to by authorization ID , typically their login name. There is an authorization ID PUBLIC. Granting a privilege to PUBLIC makes it available to any authorization ID.
  • 11. Granting Privileges You have all possible privileges on the objects, such as relations, that you create. You may grant privileges to other users (authorization ID’s), including PUBLIC. You may also grant privileges WITH GRANT OPTION, which lets the grantee also grant this privilege.
  • 12. The GRANT Statement To grant privileges, say: GRANT <list of privileges> ON <relation or other object> TO <list of authorization ID’s>; If you want the recipient(s) to be able to pass the privilege(s) to others add: WITH GRANT OPTION
  • 13. Example : GRANT Suppose you are the owner of Sells. You may say: GRANT SELECT, UPDATE(price) ON Sells TO sally; Now Sally has the right to issue any query on Sells and can update the price component only.
  • 14. Example : Grant Option Suppose we also grant: GRANT UPDATE ON Sells TO sally WITH GRANT OPTION; Now, Sally not only can update any attribute of Sells, but can grant to others the privilege UPDATE ON Sells. Also, she can grant more specific privileges like UPDATE(price)ON Sells .
  • 15. Revoking Privileges REVOKE <list of privileges> ON <relation or other object> FROM <list of authorization ID’s>; Your grant of these privileges can no longer be used by these users to justify their use of the privilege. But they may still have the privilege because they obtained it independently from elsewhere.
  • 16. REVOKE Options We must append to the REVOKE statement either: CASCADE . Now, any grants made by a revokee are also not in force, no matter how far the privilege was passed. RESTRICT . If the privilege has been passed to others, the REVOKE fails as a warning that something else must be done to “chase the privilege down.”
  • 17. Grant Diagrams Nodes = user/privilege/grant option?/is owner? UPDATE ON R, UPDATE(a) on R, and UPDATE(b) ON R live in different nodes. SELECT ON R and SELECT ON R WITH GRANT OPTION live in different nodes. Edge X -> Y means that node X was used to grant Y .
  • 18. Notation for Nodes Use AP for the node representing authorization ID A having privilege P . P * = privilege P with grant option. P ** = the source of the privilege P . I.e., A is the owner of the object on which P is a privilege. Note ** implies grant option.
  • 19. Manipulating Edges – (1) When A grants P to B , We draw an edge from AP * or AP ** to BP . Or to BP * if the grant is with grant option. If A grants a subprivilege Q of P [say UPDATE(a) on R when P is UPDATE ON R] then the edge goes to BQ or BQ *, instead.
  • 20. Manipulating Edges – (2) Fundamental rule : User C has privilege Q as long as there is a path from XP ** to CQ , CQ *, or CQ **, and P is a superprivilege of Q . Remember that P could be Q , and X could be C .
  • 21. Manipulating Edges – (3) If A revokes P from B with the CASCADE option, delete the edge from AP to BP . But if A uses RESTRICT instead, and there is an edge from BP to anywhere, then reject the revocation and make no change to the graph.
  • 22. Manipulating Edges – (4) Having revised the edges, we must check that each node has a path from some ** node, representing ownership. Any node with no such path represents a revoked privilege and is deleted from the diagram.
  • 23. Example : Grant Diagram AP** A owns the object on which P is a privilege BP* A: GRANT P TO B WITH GRANT OPTION CP* B: GRANT P TO C WITH GRANT OPTION CP A: GRANT P TO C
  • 24. Example : Grant Diagram AP** BP* CP* CP A executes REVOKE P FROM B CASCADE; However, C still has P without grant option because of the direct grant. Not only does B lose P*, but C loses P*. Delete BP* and CP*. Even had C passed P to B, both nodes are still cut off.
  • 25.  
  • 26.  
  • 27. Summary Privileges Grant and Revoke Grant Diagrams