mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 21:03:17 -07:00
small cleanup #865
This commit is contained in:
parent
ecae241049
commit
e0018f63fa
38 changed files with 399 additions and 552 deletions
|
@ -1,10 +1,8 @@
|
|||
using Ombi.Core.Claims;
|
||||
using Ombi.Core.Models.Requests;
|
||||
using Ombi.Core.Rules;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Ombi.Store.Entities;
|
||||
using System.Security.Principal;
|
||||
using System.Text;
|
||||
|
||||
namespace Ombi.Core.Rule.Rules
|
||||
{
|
||||
|
@ -16,23 +14,20 @@ namespace Ombi.Core.Rule.Rules
|
|||
}
|
||||
|
||||
private IPrincipal User { get; }
|
||||
|
||||
public RuleResult Execute(BaseRequestModel obj)
|
||||
{
|
||||
if(User.IsInRole(OmbiClaims.Admin))
|
||||
if (User.IsInRole(OmbiClaims.Admin))
|
||||
{
|
||||
obj.Approved = true;
|
||||
return Success();
|
||||
}
|
||||
|
||||
if (obj.Type == Store.Entities.RequestType.Movie && User.IsInRole(OmbiClaims.AutoApproveMovie))
|
||||
{
|
||||
if (obj.Type == RequestType.Movie && User.IsInRole(OmbiClaims.AutoApproveMovie))
|
||||
obj.Approved = true;
|
||||
}
|
||||
if (obj.Type == Store.Entities.RequestType.TvShow && User.IsInRole(OmbiClaims.AutoApproveTv))
|
||||
{
|
||||
if (obj.Type == RequestType.TvShow && User.IsInRole(OmbiClaims.AutoApproveTv))
|
||||
obj.Approved = true;
|
||||
}
|
||||
return Success(); // We don't really care, we just don't set the obj to approve
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue