Source for file permissions.php

Documentation is available at permissions.php

  1. <?php
  2. /**
  3. * Permission codes for actions
  4. *
  5. @author     Stuart Prescott
  6. @copyright  Copyright Stuart Prescott
  7. @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  8. @version    $Id$
  9. @package    Bumblebee
  10. @subpackage Misc
  11. */
  12.  
  13. /** Load ancillary functions */
  14. require_once 'inc/typeinfo.php';
  15.  
  16. // Activity:
  17. /** Activity: no-op  */
  18. define('BBROLE_NONE',                    $role 1);
  19. /** Activity: change own password */
  20. define('BBROLE_PASSWD',                 ($role<<=1));
  21. /** Activity: log out */
  22. define('BBROLE_LOGOUT',                 ($role<<=1));
  23. /** Activity: view list  */
  24. define('BBROLE_VIEW_LIST',              ($role<<=1));
  25. /** Activity: view instrument calendar */
  26. define('BBROLE_VIEW_CALENDAR',          ($role<<=1));
  27. /** Activity: view instrument booking sheet into the distant future */
  28. define('BBROLE_VIEW_CALENDAR_FUTURE',   ($role<<=1BBROLE_VIEW_CALENDAR);
  29. /** Activity: view instrument bookings */
  30. define('BBROLE_VIEW_BOOKINGS',          ($role<<=1));
  31. /** Activity: view admin details of bookings on the instrument */
  32. define('BBROLE_VIEW_BOOKINGS_DETAILS',  ($role<<=1BBROLE_VIEW_BOOKINGS);
  33. /** Activity: make bookings */
  34. define('BBROLE_MAKE_BOOKINGS',          ($role<<=1));
  35. /** Activity: Book instrument any time into the future */
  36. define('BBROLE_MAKE_BOOKINGS_FUTURE',   ($role<<=1BBROLE_MAKE_BOOKINGS);
  37. /** Activity: edit all bookings on instrument */
  38. define('BBROLE_EDIT_ALL',               ($role<<=1BBROLE_MAKE_BOOKINGS);
  39. /** Activity: Book instrument without timeslot restrictions */
  40. define('BBROLE_MAKE_BOOKINGS_FREE',     ($role<<=1BBROLE_MAKE_BOOKINGS);
  41. /** Activity: Delete own bookings with appropriate notice */
  42. define('BBROLE_UNBOOK',                 ($role<<=1));
  43. /** Activity: Delete own bookings without restrictions for appropriate notice  */
  44. define('BBROLE_UNBOOK_PAST',            ($role<<=1BBROLE_UNBOOK);
  45. /** Activity: Delete others' bookings */
  46. define('BBROLE_UNBOOK_OTHER',           ($role<<=1BBROLE_UNBOOK);
  47.  
  48. /** Activity: edit groups */
  49. define('BBROLE_ADMIN_GROUPS',           ($role<<=1));
  50. /** Activity: edit projects */
  51. define('BBROLE_ADMIN_PROJECTS',         ($role<<=1));
  52. /** Activity: edit users */
  53. define('BBROLE_ADMIN_USERS',            ($role<<=1));
  54. /** Activity: edit instruments */
  55. define('BBROLE_ADMIN_INSTRUMENTS',      ($role<<=1));
  56. /** Activity: edit consumables */
  57. define('BBROLE_ADMIN_CONSUMABLES',      ($role<<=1));
  58. /** Activity: record consumable usage */
  59. define('BBROLE_ADMIN_CONSUME',          ($role<<=1));
  60. /** Activity: edit costs */
  61. define('BBROLE_ADMIN_COSTS',            ($role<<=1));
  62. /** Activity: view deleted bookings */
  63. define('BBROLE_ADMIN_DELETEDBOOKINGS',  ($role<<=1));
  64. /** Activity: masquerade as another */
  65. define('BBROLE_ADMIN_MASQ',             ($role<<=1));
  66. /** Activity: collect email lists  */
  67. define('BBROLE_ADMIN_EMAILLIST',        ($role<<=1));
  68. /** Activity: export data */
  69. define('BBROLE_ADMIN_EXPORT',           ($role<<=1));
  70. /** Activity: send out billing reports  */
  71. define('BBROLE_ADMIN_BILLING',          ($role<<=1));
  72. /** Activity: backup database */
  73. define('BBROLE_ADMIN_BACKUPDB',         ($role<<=1));
  74. /** Activity: change system config */
  75. define('BBROLE_ADMIN_CONFIG',           ($role<<=1));
  76.  
  77. /** Activity: Admin activity flag */
  78. define('BBROLE_ADMIN_BASE',             BBROLE_ADMIN_GROUPS);
  79.  
  80.  
  81. // SYSTEM LEVEL FUNCTIONS: NORMAL USERS
  82. /** Permission: user can view all instruments on list */
  83. define('BBPERM_USER_VIEW_LIST_ALL',       BBROLE_VIEW_LIST);
  84. /** Permission: user can view all instrument calendars */
  85. define('BBPERM_USER_VIEW_CALENDAR_ALL',   BBROLE_VIEW_CALENDAR);
  86. /** Permission: user can view all instrument bookings */
  87. define('BBPERM_USER_VIEW_BOOKINGS_ALL',   BBROLE_VIEW_BOOKINGS);
  88. /** Permission: user do all VIEW actions on all instruments */
  89. define('BBPERM_USER_VIEW_ALL',            BBPERM_USER_VIEW_LIST_ALL BBPERM_USER_VIEW_CALENDAR_ALL BBPERM_USER_VIEW_BOOKINGS_ALL);
  90. /** Permission: user can make bookings */
  91. define('BBPERM_USER_MAKE_BOOKINGS_ALL',   BBROLE_MAKE_BOOKINGS);
  92. /** Permission: user can change their own password */
  93. define('BBPERM_USER_PASSWD',              BBROLE_PASSWD);
  94. /** Permission: user log out */
  95. define('BBPERM_USER_LOGOUT',              BBROLE_LOGOUT);
  96. /** Permission: sensible, basic user permissions */
  97. define('BBPERM_USER_BASIC',               BBPERM_USER_LOGOUT BBPERM_USER_PASSWD);
  98. /** Permission: readonly user permissions */
  99. define('BBPERM_USER_READONLY',            BBPERM_USER_LOGOUT);
  100.  
  101. // SYSTEM LEVEL FUNCTIONS: ADMIN USERS
  102. /** Permission: Permission to edit groups */
  103. define('BBPERM_ADMIN_GROUPS',             BBROLE_ADMIN_GROUPS);
  104. /** Permission: Permission to edit projects */
  105. define('BBPERM_ADMIN_PROJECTS',           BBROLE_ADMIN_PROJECTS);
  106. /** Permission: Permission to edit users */
  107. define('BBPERM_ADMIN_USERS',              BBROLE_ADMIN_USERS);
  108. /** Permission: Permission to edit instruments */
  109. define('BBPERM_ADMIN_INSTRUMENTS',        BBROLE_ADMIN_INSTRUMENTS);
  110. /** Permission: Permission to edit consumables */
  111. define('BBPERM_ADMIN_CONSUMABLES',        BBROLE_ADMIN_CONSUMABLES);
  112. /** Permission: Permission to record consumable usage */
  113. define('BBPERM_ADMIN_CONSUME',            BBROLE_ADMIN_CONSUME);
  114. /** Permission: Permission to edit costs */
  115. define('BBPERM_ADMIN_COSTS',              BBROLE_ADMIN_COSTS);
  116. /** Permission: Permission to view deleted bookings */
  117. define('BBPERM_ADMIN_DELETEDBOOKINGS',    BBROLE_ADMIN_DELETEDBOOKINGS);
  118. /** Permission: user can masquerade as another user on any instrument */
  119. define('BBPERM_ADMIN_MASQ',               BBROLE_ADMIN_MASQ);
  120. /** Permission: Permission to collect email lists  */
  121. define('BBPERM_ADMIN_EMAILLIST',          BBROLE_ADMIN_EMAILLIST);
  122. /** Permission: Permission to export data */
  123. define('BBPERM_ADMIN_EXPORT',             BBROLE_ADMIN_EXPORT);
  124. /** Permission: Permission to send out billing reports  */
  125. define('BBPERM_ADMIN_BILLING',            BBROLE_ADMIN_BILLING);
  126. /** Permission: Permission to backup database */
  127. define('BBPERM_ADMIN_BACKUPDB',           BBROLE_ADMIN_BACKUPDB);
  128. /** Permission: Permission to change system settings */
  129. define('BBPERM_ADMIN_CONFIG',             BBROLE_ADMIN_CONFIG);
  130.  
  131. /** Permission: Admin user can do anything */
  132. define('BBPERM_ADMIN_ALL',              -1);
  133.  
  134. // FINE-GRAINED INSTRUMENT PERMISSIONS
  135. /** Permission: View instrument booking sheet (free/busy only) */
  136. define('BBPERM_INSTR_VIEW',             BBROLE_VIEW_CALENDAR);
  137. /** Permission: View instrument booking sheet without restrictions on viewing future bookings */
  138. define('BBPERM_INSTR_VIEW_FUTURE',      BBROLE_VIEW_CALENDAR_FUTURE);
  139. /** Permission: View bookings on the instrument */
  140. define('BBPERM_INSTR_VIEW_BOOKINGS',    BBROLE_VIEW_BOOKINGS);
  141. /** Permission: View admin details of bookings on the instrument */
  142. define('BBPERM_INSTR_VIEW_DETAILS',     BBROLE_VIEW_BOOKINGS_DETAILS);
  143. /** Permission: May edit all bookings on instrument */
  144. define('BBPERM_INSTR_EDIT_ALL',         BBROLE_EDIT_ALL);
  145. /** Permission: Masquerade as a user on this instrument */
  146. define('BBPERM_INSTR_MASQ',             BBROLE_ADMIN_MASQ);
  147. /** Permission: Book instrument */
  148. define('BBPERM_INSTR_BOOK',             BBROLE_MAKE_BOOKINGS);
  149. /** Permission: Book instrument any time into the future */
  150. define('BBPERM_INSTR_BOOK_FUTURE',      BBROLE_MAKE_BOOKINGS_FUTURE);
  151. /** Permission: Book instrument without timeslot restrictions */
  152. define('BBPERM_INSTR_BOOK_FREE',        BBROLE_MAKE_BOOKINGS_FREE);
  153. /** Permission: Delete own bookings with appropriate notice */
  154. define('BBPERM_INSTR_UNBOOK',           BBROLE_UNBOOK);
  155. /** Permission: Delete own bookings without restrictions for appropriate notice  */
  156. define('BBPERM_INSTR_UNBOOK_PAST',      BBROLE_UNBOOK_PAST);
  157. /** Permission: Delete others' bookings */
  158. define('BBPERM_INSTR_UNBOOK_OTHER',     BBROLE_UNBOOK_OTHER);
  159. /** Permission: Edit an individual instrument's settings */
  160. define('BBPERM_INSTR_EDIT_CONFIG',      BBROLE_ADMIN_INSTRUMENTS);
  161. /** Permission: Basic instrument user permissions */
  162. define('BBPERM_INSTR_BASIC',            BBPERM_INSTR_VIEW BBPERM_INSTR_VIEW_BOOKINGS BBPERM_INSTR_BOOK BBPERM_INSTR_UNBOOK);
  163. /** Permission: Read-only permissions */
  164. define('BBPERM_INSTR_READONLY',         BBPERM_INSTR_VIEW);
  165.  
  166. /** Permission: Instrument admin all functions */
  167. define('BBPERM_INSTR_ALL',               -1);
  168.  
  169. // Anonymous user's permissions:
  170. // BBPERM_USER_LOGOUT
  171.  
  172.  
  173. ?>

Documentation generated on Tue, 06 Mar 2007 10:01:54 +0000 by phpDocumentor 1.3.0