mock-user.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. (function () {
  2. 'use strict';
  3. window.mockUser = function(properties) {
  4. var user = {
  5. "id": 42,
  6. "username": "BobBoberson",
  7. "slug": "bobboberson",
  8. "email": "bob@example.com",
  9. "joined_on": "2015-05-04T20:16:41.084500Z",
  10. "is_hiding_presence": false,
  11. "title": null,
  12. "full_title": "Forum team",
  13. "short_title": "Team",
  14. "rank": {
  15. "id": 1,
  16. "name": "Forum team",
  17. "slug": "forum-team",
  18. "description": null,
  19. "title": "Team",
  20. "css_class": "team",
  21. "is_tab": true
  22. },
  23. "avatar_hash": 'a0b9c8d7',
  24. "new_notifications": 0,
  25. "limits_private_thread_invites_to": 0,
  26. "unread_private_threads": 0,
  27. "sync_unread_private_threads": false,
  28. "subscribe_to_started_threads": 2,
  29. "subscribe_to_replied_threads": 2,
  30. "threads": 0,
  31. "posts": 0,
  32. "acl": {
  33. "can_delete_users_newer_than": 3,
  34. "can_see_users_name_history": 1,
  35. "can_moderate_avatars": 1,
  36. "can_be_warned": 0,
  37. "can_see_reports": [
  38. 3,
  39. 4,
  40. 5
  41. ],
  42. "can_follow_users": 1,
  43. "can_see_users_emails": 1,
  44. "can_see_users_online_list": 1,
  45. "can_moderate_signatures": 1,
  46. "can_start_private_threads": 1,
  47. "name_changes_allowed": 5,
  48. "can_add_everyone_to_private_threads": 1,
  49. "_acl_version": 0,
  50. "can_rename_users": 0,
  51. "can_browse_users_list": 1,
  52. "allow_signature_links": 1,
  53. "visible_forums": [
  54. 3,
  55. 4,
  56. 5
  57. ],
  58. "can_warn_users": 1,
  59. "can_report_private_threads": 1,
  60. "can_search_users": 1,
  61. "can_use_private_threads": 1,
  62. "can_be_blocked": 0,
  63. "can_review_moderated_content": [
  64. 3,
  65. 4,
  66. 5,
  67. 1
  68. ],
  69. "can_delete_users_with_less_posts_than": 7,
  70. "can_moderate_private_threads": 1,
  71. "can_see_ban_details": 1,
  72. "can_delete_warnings": 0,
  73. "can_see_users_ips": 1,
  74. "allow_signature_blocks": 0,
  75. "can_ban_users": 0,
  76. "max_ban_length": 2,
  77. "can_have_signature": 1,
  78. "allow_signature_images": 0,
  79. "can_see_hidden_users": 1,
  80. "max_private_thread_participants": 15,
  81. "can_cancel_warnings": 1,
  82. "name_changes_expire": 0,
  83. "can_lift_bans": 0,
  84. "max_lifted_ban_length": 2,
  85. "can_see_other_users_warnings": 1
  86. }
  87. };
  88. if (properties) {
  89. return $.extend(user, properties);
  90. } else {
  91. return user;
  92. }
  93. };
  94. }());