mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-11 15:56:05 -07:00
parent
bad109c862
commit
ffab4b7981
26 changed files with 602 additions and 267 deletions
|
@ -1,5 +1,4 @@
|
|||
using Ombi.Core.Claims;
|
||||
using Ombi.Core.Rule;
|
||||
using Ombi.Core.Rule;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Principal;
|
||||
using System.Threading.Tasks;
|
||||
|
@ -18,24 +17,13 @@ namespace Ombi.Core.Engine.Interfaces
|
|||
}
|
||||
|
||||
protected IPrincipal User { get; }
|
||||
|
||||
protected IRuleEvaluator Rules { get; }
|
||||
|
||||
protected string Username => User.Identity.Name;
|
||||
|
||||
protected bool HasRole(string roleName)
|
||||
{
|
||||
return User.IsInRole(roleName);
|
||||
}
|
||||
|
||||
protected bool ShouldSendNotification(BaseRequest req)
|
||||
{
|
||||
var sendNotification = !req.Approved; /*|| !prSettings.IgnoreNotifyForAutoApprovedRequests;*/
|
||||
|
||||
if (HasRole(OmbiClaims.Admin))
|
||||
sendNotification = false; // Don't bother sending a notification if the user is an admin
|
||||
return sendNotification;
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<RuleResult>> RunRequestRules(BaseRequest model)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue