aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-12-20 01:06:27 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-12-20 01:06:27 -0500
commit8807e80d0a04cf0c13a2113fab9917065cb0fdd9 (patch)
treefd71e759fa0de43d07b018a25c4286b54c139514 /MediaBrowser.Server.Implementations/Connect/ConnectManager.cs
parente55ab989d2077d70568965198139793ca7c116b4 (diff)
start using user policy
Diffstat (limited to 'MediaBrowser.Server.Implementations/Connect/ConnectManager.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Connect/ConnectManager.cs35
1 files changed, 17 insertions, 18 deletions
diff --git a/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs b/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs
index cbd75cdeb..376dc3548 100644
--- a/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs
+++ b/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs
@@ -432,9 +432,7 @@ namespace MediaBrowser.Server.Implementations.Connect
await user.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false);
- user.Configuration.SyncConnectImage = false;
- user.Configuration.SyncConnectName = false;
- _userManager.UpdateConfiguration(user, user.Configuration);
+ await _userManager.UpdateConfiguration(user.Id.ToString("N"), user.Configuration);
await RefreshAuthorizationsInternal(false, CancellationToken.None).ConfigureAwait(false);
@@ -800,23 +798,21 @@ namespace MediaBrowser.Server.Implementations.Connect
await _userManager.UpdateUser(user).ConfigureAwait(false);
- user.Configuration.SyncConnectImage = true;
- user.Configuration.SyncConnectName = true;
- user.Configuration.IsHidden = true;
- user.Configuration.EnableLiveTvManagement = false;
- user.Configuration.EnableContentDeletion = false;
- user.Configuration.EnableRemoteControlOfOtherUsers = false;
- user.Configuration.EnableSharedDeviceControl = false;
- user.Configuration.IsAdministrator = false;
+ user.Policy.IsHidden = true;
+ user.Policy.EnableLiveTvManagement = false;
+ user.Policy.EnableContentDeletion = false;
+ user.Policy.EnableRemoteControlOfOtherUsers = false;
+ user.Policy.EnableSharedDeviceControl = false;
+ user.Policy.IsAdministrator = false;
if (currentPendingEntry != null)
{
- user.Configuration.EnableLiveTvAccess = currentPendingEntry.EnableLiveTv;
- user.Configuration.BlockedMediaFolders = currentPendingEntry.ExcludedLibraries;
- user.Configuration.BlockedChannels = currentPendingEntry.ExcludedChannels;
+ user.Policy.EnableLiveTvAccess = currentPendingEntry.EnableLiveTv;
+ user.Policy.BlockedMediaFolders = currentPendingEntry.ExcludedLibraries;
+ user.Policy.BlockedChannels = currentPendingEntry.ExcludedChannels;
}
- _userManager.UpdateConfiguration(user, user.Configuration);
+ await _userManager.UpdateConfiguration(user.Id.ToString("N"), user.Configuration);
}
}
else if (string.Equals(connectEntry.AcceptStatus, "waiting", StringComparison.OrdinalIgnoreCase))
@@ -844,7 +840,7 @@ namespace MediaBrowser.Server.Implementations.Connect
{
var users = _userManager.Users
.Where(i => !string.IsNullOrEmpty(i.ConnectUserId) &&
- (i.Configuration.SyncConnectImage || i.Configuration.SyncConnectName))
+ (i.ConnectLinkType.HasValue && i.ConnectLinkType.Value == UserLinkType.Guest))
.ToList();
foreach (var user in users)
@@ -857,7 +853,10 @@ namespace MediaBrowser.Server.Implementations.Connect
continue;
}
- if (user.Configuration.SyncConnectName)
+ var syncConnectName = true;
+ var syncConnectImage = true;
+
+ if (syncConnectName)
{
var changed = !string.Equals(authorization.UserName, user.Name, StringComparison.OrdinalIgnoreCase);
@@ -867,7 +866,7 @@ namespace MediaBrowser.Server.Implementations.Connect
}
}
- if (user.Configuration.SyncConnectImage)
+ if (syncConnectImage)
{
var imageUrl = authorization.UserImageUrl;