Guest User

Untitled

a guest
Jun 13th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  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
Add Comment
Please, Sign In to add comment