mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-13 00:32:57 -07:00
#865 rework the backend data. Actually use real models rather than a JSON store.
This commit is contained in:
parent
08e389f590
commit
2bc916998c
55 changed files with 1277 additions and 702 deletions
|
@ -1,14 +1,13 @@
|
|||
using Ombi.Core.Claims;
|
||||
using Ombi.Core.Models.Requests;
|
||||
using Ombi.Core.Rules;
|
||||
using Ombi.Store.Entities;
|
||||
using System.Security.Principal;
|
||||
using System.Threading.Tasks;
|
||||
using Ombi.Core.Rule.Interfaces;
|
||||
using Ombi.Store.Entities.Requests;
|
||||
|
||||
namespace Ombi.Core.Rule.Rules
|
||||
{
|
||||
public class CanRequestRule : BaseRequestRule, IRequestRules<BaseRequestModel>
|
||||
public class CanRequestRule : BaseRequestRule, IRequestRules<BaseRequest>
|
||||
{
|
||||
public CanRequestRule(IPrincipal principal)
|
||||
{
|
||||
|
@ -17,12 +16,12 @@ namespace Ombi.Core.Rule.Rules
|
|||
|
||||
private IPrincipal User { get; }
|
||||
|
||||
public Task<RuleResult> Execute(BaseRequestModel obj)
|
||||
public Task<RuleResult> Execute(BaseRequest obj)
|
||||
{
|
||||
if (User.IsInRole(OmbiClaims.Admin))
|
||||
return Task.FromResult(Success());
|
||||
|
||||
if (obj.Type == RequestType.Movie)
|
||||
if (obj.RequestType == RequestType.Movie)
|
||||
{
|
||||
if (User.IsInRole(OmbiClaims.RequestMovie))
|
||||
return Task.FromResult(Success());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue