UserPolicy.cs 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. using System;
  2. using MediaBrowser.Model.Configuration;
  3. namespace MediaBrowser.Model.Users
  4. {
  5. public class UserPolicy
  6. {
  7. /// <summary>
  8. /// Gets or sets a value indicating whether this instance is administrator.
  9. /// </summary>
  10. /// <value><c>true</c> if this instance is administrator; otherwise, <c>false</c>.</value>
  11. public bool IsAdministrator { get; set; }
  12. /// <summary>
  13. /// Gets or sets a value indicating whether this instance is hidden.
  14. /// </summary>
  15. /// <value><c>true</c> if this instance is hidden; otherwise, <c>false</c>.</value>
  16. public bool IsHidden { get; set; }
  17. /// <summary>
  18. /// Gets or sets a value indicating whether this instance is disabled.
  19. /// </summary>
  20. /// <value><c>true</c> if this instance is disabled; otherwise, <c>false</c>.</value>
  21. public bool IsDisabled { get; set; }
  22. /// <summary>
  23. /// Gets or sets the max parental rating.
  24. /// </summary>
  25. /// <value>The max parental rating.</value>
  26. public int? MaxParentalRating { get; set; }
  27. public string[] BlockedTags { get; set; }
  28. public bool EnableUserPreferenceAccess { get; set; }
  29. public AccessSchedule[] AccessSchedules { get; set; }
  30. public UnratedItem[] BlockUnratedItems { get; set; }
  31. public bool EnableRemoteControlOfOtherUsers { get; set; }
  32. public bool EnableSharedDeviceControl { get; set; }
  33. public bool EnableRemoteAccess { get; set; }
  34. public bool EnableLiveTvManagement { get; set; }
  35. public bool EnableLiveTvAccess { get; set; }
  36. public bool EnableMediaPlayback { get; set; }
  37. public bool EnableAudioPlaybackTranscoding { get; set; }
  38. public bool EnableVideoPlaybackTranscoding { get; set; }
  39. public bool EnablePlaybackRemuxing { get; set; }
  40. public bool EnableContentDeletion { get; set; }
  41. public string[] EnableContentDeletionFromFolders { get; set; }
  42. public bool EnableContentDownloading { get; set; }
  43. /// <summary>
  44. /// Gets or sets a value indicating whether [enable synchronize].
  45. /// </summary>
  46. /// <value><c>true</c> if [enable synchronize]; otherwise, <c>false</c>.</value>
  47. public bool EnableSyncTranscoding { get; set; }
  48. public bool EnableMediaConversion { get; set; }
  49. public string[] EnabledDevices { get; set; }
  50. public bool EnableAllDevices { get; set; }
  51. public string[] EnabledChannels { get; set; }
  52. public bool EnableAllChannels { get; set; }
  53. public string[] EnabledFolders { get; set; }
  54. public bool EnableAllFolders { get; set; }
  55. public int InvalidLoginAttemptCount { get; set; }
  56. public bool EnablePublicSharing { get; set; }
  57. public string[] BlockedMediaFolders { get; set; }
  58. public string[] BlockedChannels { get; set; }
  59. public int RemoteClientBitrateLimit { get; set; }
  60. public string AuthenticationProviderId { get; set; }
  61. public UserPolicy()
  62. {
  63. EnableContentDeletion = true;
  64. EnableContentDeletionFromFolders = Array.Empty<string>();
  65. EnableSyncTranscoding = true;
  66. EnableMediaConversion = true;
  67. EnableMediaPlayback = true;
  68. EnableAudioPlaybackTranscoding = true;
  69. EnableVideoPlaybackTranscoding = true;
  70. EnablePlaybackRemuxing = true;
  71. EnableLiveTvManagement = true;
  72. EnableLiveTvAccess = true;
  73. // Without this on by default, admins won't be able to do this
  74. // Improve in the future
  75. EnableLiveTvManagement = true;
  76. EnableSharedDeviceControl = true;
  77. BlockedTags = Array.Empty<string>();
  78. BlockUnratedItems = Array.Empty<UnratedItem>();
  79. EnableUserPreferenceAccess = true;
  80. AccessSchedules = Array.Empty<AccessSchedule>();
  81. EnableAllChannels = true;
  82. EnabledChannels = Array.Empty<string>();
  83. EnableAllFolders = true;
  84. EnabledFolders = Array.Empty<string>();
  85. EnabledDevices = Array.Empty<string>();
  86. EnableAllDevices = true;
  87. EnableContentDownloading = true;
  88. EnablePublicSharing = true;
  89. EnableRemoteAccess = true;
  90. }
  91. }
  92. }