SHARE
TWEET

Untitled

a guest Jun 16th, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. property_id |     property_address     |     city     | zip_code | state
  2. -------------+--------------------------+--------------+----------+-------
  3.            1 | 2564 Wescam Court        | Reno         |    89511 | NV    
  4.            2 | 1732 Rubaiyat Road       | Grand Rapids |    49603 | MI    
  5.            3 | 4094 Francis Mine        | Standish     |    96128 | CA    
  6.            4 | 3193 Ashton Lane         | Briggs       |    78608 | TX    
  7.            5 | 1519 North Street        | Alamosa      |    81102 | CO
  8.      
  9. CREATE ROLE company WITH LOGIN CONNECTION LIMIT 0;  
  10. CREATE ROLE boss WITH LOGIN CONNECTION LIMIT 1 PASSWORD '1234' IN ROLE company;
  11. CREATE ROLE manager WITH LOGIN CONNECTION LIMIT 1 PASSWORD '1234' IN ROLE company;
  12. CREATE ROLE intern WITH LOGIN CONNECTION LIMIT 1 PASSWORD '1234 IN ROLE company;
  13.      
  14. REVOKE ALL ON snow.property_table FROM snow; --remove all privileges automatically assigned to everybody
  15. GRANT ALL ON snow.company_table TO boss; --boss has the ability to do anything to this table
  16. GRANT SELECT( property_id, zip_code, state) ON snow.company_table TO manager;
  17. GRANT SELECT( property_id, state) ON snow.company_table TO intern;
  18.      
  19. Name  |    Owner     |      Access privileges       |
  20. --------+--------------+------------------------------
  21.  snow   |     me       | me=UC/me                    +|
  22.         |              | boss=U/me                   +|
  23.         |              | company=U/me                +|
  24.         |              | manager=U/me                +|
  25.         |              | intern=U/me                  |
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top