mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-16 02:02:55 -07:00
Fixed issue where using the API to request a movie/tv show would throw an exception when only using the API Key #3091
This commit is contained in:
parent
25186ba149
commit
769343a128
7 changed files with 17 additions and 14 deletions
|
@ -1,3 +1,4 @@
|
|||
using System;
|
||||
using Ombi.Store.Entities;
|
||||
using System.IO;
|
||||
using System.Security.Claims;
|
||||
|
@ -25,8 +26,8 @@ namespace Ombi.Core.Rule.Rules.Request
|
|||
|
||||
public async Task<RuleResult> Execute(BaseRequest obj)
|
||||
{
|
||||
var user = await _manager.Users.FirstOrDefaultAsync(x => x.UserName == User.Identity.Name);
|
||||
if (await _manager.IsInRoleAsync(user, OmbiRoles.Admin))
|
||||
var user = await _manager.Users.FirstOrDefaultAsync(x => x.UserName.Equals(User.Identity.Name, StringComparison.InvariantCultureIgnoreCase));
|
||||
if (await _manager.IsInRoleAsync(user, OmbiRoles.Admin) || user.IsSystemUser)
|
||||
return Success();
|
||||
|
||||
if (obj.RequestType == RequestType.Movie)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue