You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
5.1 KiB

  1. MySQL database "literature", table "user_permissions"
  2. =====================================================
  3. field names
  4. -----------
  5. fields available in table "user_permissions" description
  6. -------------------------------------------- -----------
  7. user_permission_id the unique ID number of this user permission entry
  8. user_id the user's unique ID number (which corresponds to the user_id number of the user's record entry within the "users" table)
  9. allow_add specifies whether this user is allowed to add records to the database
  10. allow_edit specifies whether this user is allowed to edit records in the database
  11. allow_delete specifies whether this user is allowed to delete records from the database
  12. allow_download specifies whether this user is allowed to download files which are associated with particular records
  13. allow_upload specifies whether this user is allowed to upload files to the database
  14. allow_details_view specifies whether this user is allowed to view any record details
  15. allow_print_view specifies whether this user is allowed to view records in print view
  16. allow_browse_view specifies whether this user is allowed to view records in browse view
  17. allow_cite specifies whether this user is allowed to build a reference list from selected records
  18. allow_import specifies whether this user is allowed to import records into the database
  19. allow_batch_import specifies whether this user is allowed to batch import records into the database
  20. allow_export specifies whether this user is allowed to export records from the database
  21. allow_batch_export specifies whether this user is allowed to batch export records from the database
  22. allow_user_groups specifies whether this user is allowed to use the 'user groups' feature
  23. allow_user_queries specifies whether this user is allowed to use the 'user queries' feature
  24. allow_rss_feeds specifies whether this user is allowed to generate dynamic RSS feeds from any query
  25. allow_sql_search specifies whether this user is allowed to execute custom SQL queries via 'sql_search.php'
  26. allow_modify_options specifies whether this user is allowed to change his personal data (like name, address or password)
  27. allow_edit_call_number specifies whether this user is allowed to fully edit the contents of the 'call_number' field (like the database admin)
  28. column types
  29. ------------
  30. user_permission_id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY
  31. user_id MEDIUMINT UNSIGNED NOT NULL
  32. allow_add ENUM('yes','no') NOT NULL
  33. allow_edit ENUM('yes','no') NOT NULL
  34. allow_delete ENUM('yes','no') NOT NULL
  35. allow_download ENUM('yes','no') NOT NULL
  36. allow_upload ENUM('yes','no') NOT NULL
  37. allow_details_view ENUM('yes','no') NOT NULL
  38. allow_print_view ENUM('yes','no') NOT NULL
  39. allow_browse_view ENUM('yes','no') NOT NULL
  40. allow_cite ENUM('yes','no') NOT NULL
  41. allow_import ENUM('yes','no') NOT NULL
  42. allow_batch_import ENUM('yes','no') NOT NULL
  43. allow_export ENUM('yes','no') NOT NULL
  44. allow_batch_export ENUM('yes','no') NOT NULL
  45. allow_user_groups ENUM('yes','no') NOT NULL
  46. allow_user_queries ENUM('yes','no') NOT NULL
  47. allow_rss_feeds ENUM('yes','no') NOT NULL
  48. allow_sql_search ENUM('yes','no') NOT NULL
  49. allow_modify_options ENUM('yes','no') NOT NULL
  50. allow_edit_call_number ENUM('no','yes') NOT NULL
  51. INDEX (user_id)
  52. table creation code
  53. -------------------
  54. CREATE TABLE user_permissions (user_permission_id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, user_id MEDIUMINT UNSIGNED NOT NULL, allow_add ENUM('yes','no') NOT NULL, allow_edit ENUM('yes','no') NOT NULL, allow_delete ENUM('yes','no') NOT NULL, allow_download ENUM('yes','no') NOT NULL, allow_upload ENUM('yes','no') NOT NULL, allow_details_view ENUM('yes','no') NOT NULL, allow_print_view ENUM('yes','no') NOT NULL, allow_browse_view ENUM('yes','no') NOT NULL, allow_cite ENUM('yes','no') NOT NULL, allow_import ENUM('yes','no') NOT NULL, allow_batch_import ENUM('yes','no') NOT NULL, allow_export ENUM('yes','no') NOT NULL, allow_batch_export ENUM('yes','no') NOT NULL, allow_user_groups ENUM('yes','no') NOT NULL, allow_user_queries ENUM('yes','no') NOT NULL, allow_rss_feeds ENUM('yes','no') NOT NULL, allow_sql_search ENUM('yes','no') NOT NULL, allow_modify_options ENUM('yes','no') NOT NULL, allow_edit_call_number ENUM('no','yes') NOT NULL, INDEX (user_id));
  55. rules for data import
  56. ---------------------
  57. - fields are separated by tabs, records are separated by returns (if not specified otherwise within the LOAD DATA statement)
  58. - order of fields must resemble the above field order!
  59. - DATE format must be YYYY-MM-DD
  60. - TIME format must be HH:MM:SS
  61. - carriage returns *within* fields (ASCII character 11) must be replaced with a "UNIX return" (ASCII character 10) -> Search for: (\x0B) Replace with: \\n
  62. - empty fields are indicated by \N -> Search for: (?<=\t|^)(?=\t|$) Replace with: \\N
  63. - character encoding: higher ASCII chars must be encoded as ISO-8859-1
  64. - file encoding must be UNIX
  65. load data code
  66. --------------
  67. LOAD DATA LOCAL INFILE "/PATH/TO/FILE/user_permissions.txt" INTO TABLE user_permissions;
  68. or, alternatively, use something like the following from your shell:
  69. mysqlimport --local -u root -p YOUR_DB_NAME "/PATH/TO/FILE/user_permissions.txt"