Remove Orchard.Events reference

This commit is contained in:
Thierry Fleury
2016-01-08 10:20:35 +01:00
parent e519e2dc36
commit df3e25a659
2 changed files with 8 additions and 8 deletions

View File

@@ -1,11 +1,15 @@
using Orchard.Conditions.Services;
using Orchard.ContentManagement;
using Orchard.ContentManagement;
using Orchard.Events;
using Orchard.Roles.Models;
using Orchard.Security;
using System;
using System.Linq;
namespace Orchard.Roles.Conditions {
public interface IConditionProvider : IEventHandler {
void Evaluate(dynamic evaluationContext);
}
public class RoleRuleProvider : IConditionProvider {
private readonly IAuthenticationService _authenticationService;
@@ -13,7 +17,7 @@ namespace Orchard.Roles.Conditions {
_authenticationService = authenticationService;
}
public void Evaluate(ConditionEvaluationContext evaluationContext) {
public void Evaluate(dynamic evaluationContext) {
if (!String.Equals(evaluationContext.FunctionName, "role", StringComparison.OrdinalIgnoreCase)) {
return;
}
@@ -24,7 +28,7 @@ namespace Orchard.Roles.Conditions {
return;
}
var roles = evaluationContext.Arguments.Cast<string>();
var roles = ((object[])evaluationContext.Arguments).Cast<string>();
var userRoles = user.As<IUserRoles>();
evaluationContext.Result = userRoles != null ? userRoles.Roles.Intersect(roles).Count() > 0 : false;
}

View File

@@ -157,10 +157,6 @@
<Name>Orchard.Core</Name>
<Private>false</Private>
</ProjectReference>
<ProjectReference Include="..\Orchard.Conditions\Orchard.Conditions.csproj">
<Project>{98251eae-a41b-47b2-aa91-e28b8482da70}</Project>
<Name>Orchard.Conditions</Name>
</ProjectReference>
<ProjectReference Include="..\Orchard.Forms\Orchard.Forms.csproj">
<Project>{642a49d7-8752-4177-80d6-bfbbcfad3de0}</Project>
<Name>Orchard.Forms</Name>