mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 21:03:17 -07:00
Merge pull request #2973 from Patricol/master
fix album-request-permission error message
This commit is contained in:
commit
54c5765c5d
1 changed files with 14 additions and 4 deletions
|
@ -1,4 +1,6 @@
|
||||||
using System.Security.Claims;
|
using Ombi.Store.Entities;
|
||||||
|
using System.IO;
|
||||||
|
using System.Security.Claims;
|
||||||
using System.Security.Principal;
|
using System.Security.Principal;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
@ -37,16 +39,24 @@ namespace Ombi.Core.Rule.Rules.Request
|
||||||
if (obj.RequestType == RequestType.TvShow)
|
if (obj.RequestType == RequestType.TvShow)
|
||||||
{
|
{
|
||||||
if (await _manager.IsInRoleAsync(user, OmbiRoles.RequestTv) || await _manager.IsInRoleAsync(user, OmbiRoles.AutoApproveTv))
|
if (await _manager.IsInRoleAsync(user, OmbiRoles.RequestTv) || await _manager.IsInRoleAsync(user, OmbiRoles.AutoApproveTv))
|
||||||
return Success();
|
{
|
||||||
|
return TSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
return Fail("You do not have permissions to Request a TV Show");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj.RequestType == RequestType.Album)
|
if (obj.RequestType == RequestType.Album)
|
||||||
{
|
{
|
||||||
if (await _manager.IsInRoleAsync(user, OmbiRoles.RequestMusic) || await _manager.IsInRoleAsync(user, OmbiRoles.AutoApproveMusic))
|
if (await _manager.IsInRoleAsync(user, OmbiRoles.RequestMusic) || await _manager.IsInRoleAsync(user, OmbiRoles.AutoApproveMusic))
|
||||||
|
{
|
||||||
return Success();
|
return Success();
|
||||||
|
}
|
||||||
|
|
||||||
|
return Fail("You do not have permissions to Request an Album");
|
||||||
}
|
}
|
||||||
|
|
||||||
return Fail("You do not have permissions to Request a TV Show");
|
throw new InvalidDataException("Permission check failed: unknown RequestType");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue