mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-11 07:46:05 -07:00
Removed the whitelist
This commit is contained in:
parent
4a63d3601a
commit
121cf90ba7
4 changed files with 3 additions and 43 deletions
|
@ -58,7 +58,6 @@ namespace PlexRequests.Core.SettingModels
|
||||||
public int MovieWeeklyRequestLimit { get; set; }
|
public int MovieWeeklyRequestLimit { get; set; }
|
||||||
public int TvWeeklyRequestLimit { get; set; }
|
public int TvWeeklyRequestLimit { get; set; }
|
||||||
public int AlbumWeeklyRequestLimit { get; set; }
|
public int AlbumWeeklyRequestLimit { get; set; }
|
||||||
public string NoApprovalUsers { get; set; }
|
|
||||||
public bool CollectAnalyticData { get; set; }
|
public bool CollectAnalyticData { get; set; }
|
||||||
public bool IgnoreNotifyForAutoApprovedRequests { get; set; }
|
public bool IgnoreNotifyForAutoApprovedRequests { get; set; }
|
||||||
public bool Wizard { get; set; }
|
public bool Wizard { get; set; }
|
||||||
|
@ -75,26 +74,5 @@ namespace PlexRequests.Core.SettingModels
|
||||||
public string ThemeName { get; set; }
|
public string ThemeName { get; set; }
|
||||||
|
|
||||||
public string ApiKey { get; set; }
|
public string ApiKey { get; set; }
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
public List<string> ApprovalWhiteList
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
var users = new List<string>();
|
|
||||||
if (string.IsNullOrEmpty(NoApprovalUsers))
|
|
||||||
{
|
|
||||||
return users;
|
|
||||||
}
|
|
||||||
|
|
||||||
var splitUsers = NoApprovalUsers.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
|
|
||||||
foreach (var user in splitUsers)
|
|
||||||
{
|
|
||||||
if (!string.IsNullOrWhiteSpace(user))
|
|
||||||
users.Add(user.Trim());
|
|
||||||
}
|
|
||||||
return users;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -302,11 +302,6 @@ namespace PlexRequests.Services.Jobs
|
||||||
|
|
||||||
public bool ShouldAutoApprove(RequestType requestType, PlexRequestSettings prSettings, List<string> username)
|
public bool ShouldAutoApprove(RequestType requestType, PlexRequestSettings prSettings, List<string> username)
|
||||||
{
|
{
|
||||||
if (prSettings.ApprovalWhiteList.Intersect(username).Any())
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var user in username)
|
foreach (var user in username)
|
||||||
{
|
{
|
||||||
var admin = Security.HasPermissions(user, Permissions.Administrator);
|
var admin = Security.HasPermissions(user, Permissions.Administrator);
|
||||||
|
|
|
@ -1234,7 +1234,7 @@ namespace PlexRequests.UI.Modules
|
||||||
if (IsAdmin)
|
if (IsAdmin)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (s.ApprovalWhiteList.Contains(Username))
|
if (ShouldAutoApprove(type,s,Username))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
var requestLimit = GetRequestLimitForType(type, s);
|
var requestLimit = GetRequestLimitForType(type, s);
|
||||||
|
@ -1376,8 +1376,8 @@ namespace PlexRequests.UI.Modules
|
||||||
public bool ShouldAutoApprove(RequestType requestType, PlexRequestSettings prSettings, string username)
|
public bool ShouldAutoApprove(RequestType requestType, PlexRequestSettings prSettings, string username)
|
||||||
{
|
{
|
||||||
var admin = Security.HasPermissions(Context.CurrentUser, Permissions.Administrator);
|
var admin = Security.HasPermissions(Context.CurrentUser, Permissions.Administrator);
|
||||||
// if the user is an admin or they are whitelisted, they go ahead and allow auto-approval
|
// if the user is an admin, they go ahead and allow auto-approval
|
||||||
if (admin || prSettings.ApprovalWhiteList.Any(x => x.Equals(username, StringComparison.OrdinalIgnoreCase))) return true;
|
if (admin) return true;
|
||||||
|
|
||||||
// check by request type if the category requires approval or not
|
// check by request type if the category requires approval or not
|
||||||
switch (requestType)
|
switch (requestType)
|
||||||
|
|
|
@ -199,19 +199,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p class="form-group">A comma separated list of users whose requests do not require approval (These users also do not have a request limit).</p>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="NoApprovalUsers" class="control-label">Approval White listed Users</label>
|
|
||||||
<div>
|
|
||||||
<input type="text" class="form-control-custom form-control " id="NoApprovalUsers" name="NoApprovalUsers" placeholder="e.g. John, Bobby" value="@Model.NoApprovalUsers">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<p class="form-group">If the request limits are set to 0 then no request limit is applied.</p>
|
<p class="form-group">If the request limits are set to 0 then no request limit is applied.</p>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="MovieWeeklyRequestLimit" class="control-label">Movie Weekly Request Limit</label>
|
<label for="MovieWeeklyRequestLimit" class="control-label">Movie Weekly Request Limit</label>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue