mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-21 22:03:15 -07:00
Allo RequestOnBehalf rights if requested from the API
This commit is contained in:
parent
226796d913
commit
e10ad69108
2 changed files with 3 additions and 2 deletions
|
@ -77,7 +77,8 @@ namespace Ombi.Core.Engine
|
|||
var userDetails = await GetUser();
|
||||
var canRequestOnBehalf = model.RequestOnBehalf.HasValue();
|
||||
|
||||
var isAdmin = await UserManager.IsInRoleAsync(userDetails, OmbiRoles.PowerUser)
|
||||
var isAdmin = Username.Equals("API", StringComparison.CurrentCultureIgnoreCase)
|
||||
|| await UserManager.IsInRoleAsync(userDetails, OmbiRoles.PowerUser)
|
||||
|| await UserManager.IsInRoleAsync(userDetails, OmbiRoles.Admin);
|
||||
if (canRequestOnBehalf && !isAdmin)
|
||||
{
|
||||
|
|
|
@ -161,7 +161,7 @@ namespace Ombi.Core.Engine
|
|||
var user = await GetUser();
|
||||
var canRequestOnBehalf = tv.RequestOnBehalf.HasValue();
|
||||
|
||||
var isAdmin = await UserManager.IsInRoleAsync(user, OmbiRoles.PowerUser) || await UserManager.IsInRoleAsync(user, OmbiRoles.Admin);
|
||||
var isAdmin = Username.Equals("API", StringComparison.CurrentCultureIgnoreCase) || await UserManager.IsInRoleAsync(user, OmbiRoles.PowerUser) || await UserManager.IsInRoleAsync(user, OmbiRoles.Admin);
|
||||
if (tv.RequestOnBehalf.HasValue() && !isAdmin)
|
||||
{
|
||||
return new RequestEngineResult
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue