daily pastebin goal
60%
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. table users
  2. username: string
  3. password_hash: hex
  4. acl: bit array
  5.    
  6. // permission to read employee data
  7. public const long READ_EMPL_DATA = 0x01
  8.  
  9. ...
  10. {
  11.     User user = database.GetSomeUser();
  12.     // test for READ_EMPL_DATA permission
  13.     if (0 != (user.ACL & READ_EMPL_DATA)) {
  14.         // access granted
  15.     } else {
  16.         // access denied
  17.     }
  18.     // give READ_EMPL_DATA permission
  19.     if (0 != (user.ACL & READ_EMPL_DATA))
  20.         user.ACL = user.ACL & READ_EMPL_DATA
  21. }
  22.    
  23. table group
  24. groupname: string
  25. acl: bit array
  26.  
  27. table user_group
  28. user_id: id
  29. group_id: id
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