add EnableSubtitleManagement permission

This commit is contained in:
chinkara 2023-10-15 15:53:53 +02:00
parent c727d2cebc
commit 9f259aa404
4 changed files with 17 additions and 1 deletions

View File

@ -499,6 +499,7 @@ namespace Jellyfin.Data.Entities
Permissions.Add(new Permission(PermissionKind.ForceRemoteSourceTranscoding, false)); Permissions.Add(new Permission(PermissionKind.ForceRemoteSourceTranscoding, false));
Permissions.Add(new Permission(PermissionKind.EnableRemoteControlOfOtherUsers, false)); Permissions.Add(new Permission(PermissionKind.EnableRemoteControlOfOtherUsers, false));
Permissions.Add(new Permission(PermissionKind.EnableCollectionManagement, false)); Permissions.Add(new Permission(PermissionKind.EnableCollectionManagement, false));
Permissions.Add(new Permission(PermissionKind.EnableSubtitleManagement, false));
} }
/// <summary> /// <summary>

View File

@ -113,6 +113,11 @@ namespace Jellyfin.Data.Enums
/// <summary> /// <summary>
/// Whether the user can create, modify and delete collections. /// Whether the user can create, modify and delete collections.
/// </summary> /// </summary>
EnableCollectionManagement = 21 EnableCollectionManagement = 21,
/// <summary>
/// Whether the user can edit subtitles.
/// </summary>
EnableSubtitleManagement = 22
} }
} }

View File

@ -349,6 +349,7 @@ namespace Jellyfin.Server.Implementations.Users
ForceRemoteSourceTranscoding = user.HasPermission(PermissionKind.ForceRemoteSourceTranscoding), ForceRemoteSourceTranscoding = user.HasPermission(PermissionKind.ForceRemoteSourceTranscoding),
EnablePublicSharing = user.HasPermission(PermissionKind.EnablePublicSharing), EnablePublicSharing = user.HasPermission(PermissionKind.EnablePublicSharing),
EnableCollectionManagement = user.HasPermission(PermissionKind.EnableCollectionManagement), EnableCollectionManagement = user.HasPermission(PermissionKind.EnableCollectionManagement),
EnableSubtitleManagement = user.HasPermission(PermissionKind.EnableSubtitleManagement),
AccessSchedules = user.AccessSchedules.ToArray(), AccessSchedules = user.AccessSchedules.ToArray(),
BlockedTags = user.GetPreference(PreferenceKind.BlockedTags), BlockedTags = user.GetPreference(PreferenceKind.BlockedTags),
AllowedTags = user.GetPreference(PreferenceKind.AllowedTags), AllowedTags = user.GetPreference(PreferenceKind.AllowedTags),
@ -666,6 +667,7 @@ namespace Jellyfin.Server.Implementations.Users
user.SetPermission(PermissionKind.EnableRemoteControlOfOtherUsers, policy.EnableRemoteControlOfOtherUsers); user.SetPermission(PermissionKind.EnableRemoteControlOfOtherUsers, policy.EnableRemoteControlOfOtherUsers);
user.SetPermission(PermissionKind.EnablePlaybackRemuxing, policy.EnablePlaybackRemuxing); user.SetPermission(PermissionKind.EnablePlaybackRemuxing, policy.EnablePlaybackRemuxing);
user.SetPermission(PermissionKind.EnableCollectionManagement, policy.EnableCollectionManagement); user.SetPermission(PermissionKind.EnableCollectionManagement, policy.EnableCollectionManagement);
user.SetPermission(PermissionKind.EnableSubtitleManagement, policy.EnableSubtitleManagement);
user.SetPermission(PermissionKind.ForceRemoteSourceTranscoding, policy.ForceRemoteSourceTranscoding); user.SetPermission(PermissionKind.ForceRemoteSourceTranscoding, policy.ForceRemoteSourceTranscoding);
user.SetPermission(PermissionKind.EnablePublicSharing, policy.EnablePublicSharing); user.SetPermission(PermissionKind.EnablePublicSharing, policy.EnablePublicSharing);

View File

@ -15,6 +15,7 @@ namespace MediaBrowser.Model.Users
{ {
IsHidden = true; IsHidden = true;
EnableCollectionManagement = false; EnableCollectionManagement = false;
EnableSubtitleManagement = false;
EnableContentDeletion = false; EnableContentDeletion = false;
EnableContentDeletionFromFolders = Array.Empty<string>(); EnableContentDeletionFromFolders = Array.Empty<string>();
@ -83,6 +84,13 @@ namespace MediaBrowser.Model.Users
[DefaultValue(false)] [DefaultValue(false)]
public bool EnableCollectionManagement { get; set; } public bool EnableCollectionManagement { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance can manage subtitles.
/// </summary>
/// <value><c>true</c> if this instance is allowed; otherwise, <c>false</c>.</value>
[DefaultValue(false)]
public bool EnableSubtitleManagement { get; set; }
/// <summary> /// <summary>
/// Gets or sets a value indicating whether this instance is disabled. /// Gets or sets a value indicating whether this instance is disabled.
/// </summary> /// </summary>