create-user.js 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. "avatar_hash": 'a0b9c8d7',
  23. "new_notifications": 0,
  24. "limits_private_thread_invites_to": 0,
  25. "unread_private_threads": 0,
  26. "sync_unread_private_threads": false,
  27. "subscribe_to_started_threads": 2,
  28. "subscribe_to_replied_threads": 2,
  29. "threads": 0,
  30. "posts": 0,
  31. "acl": {
  32. "can_delete_users_newer_than": 3,
  33. "can_see_users_name_history": 1,
  34. "can_moderate_avatars": 1,
  35. "can_be_warned": 0,
  36. "can_see_reports": [
  37. 3,
  38. 4,
  39. 5
  40. ],
  41. "can_follow_users": 1,
  42. "can_see_users_emails": 1,
  43. "can_see_users_online_list": 1,
  44. "can_moderate_signatures": 1,
  45. "can_start_private_threads": 1,
  46. "name_changes_allowed": 5,
  47. "can_add_everyone_to_private_threads": 1,
  48. "_acl_version": 0,
  49. "can_rename_users": 0,
  50. "can_browse_users_list": 1,
  51. "allow_signature_links": 1,
  52. "visible_forums": [
  53. 3,
  54. 4,
  55. 5
  56. ],
  57. "can_warn_users": 1,
  58. "can_report_private_threads": 1,
  59. "can_search_users": 1,
  60. "can_use_private_threads": 1,
  61. "can_be_blocked": 0,
  62. "can_review_moderated_content": [
  63. 3,
  64. 4,
  65. 5,
  66. 1
  67. ],
  68. "can_delete_users_with_less_posts_than": 7,
  69. "can_moderate_private_threads": 1,
  70. "can_see_ban_details": 1,
  71. "can_delete_warnings": 0,
  72. "can_see_users_ips": 1,
  73. "allow_signature_blocks": 0,
  74. "can_ban_users": 0,
  75. "max_ban_length": 2,
  76. "can_have_signature": 1,
  77. "allow_signature_images": 0,
  78. "can_see_hidden_users": 1,
  79. "max_private_thread_participants": 15,
  80. "can_cancel_warnings": 1,
  81. "name_changes_expire": 0,
  82. "can_lift_bans": 0,
  83. "max_lifted_ban_length": 2,
  84. "can_see_other_users_warnings": 1
  85. }
  86. });
  87. if (newProps) {
  88. user.setProperties(newProps);
  89. }
  90. // make sure ID is string
  91. user.set('id', user.get('id').toString());
  92. return user;
  93. }