create-user.js 2.5 KB

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