CSLA.NET 6.0.0
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
AuthRuleExpectsCriteria.cs
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// <copyright file="AuthRuleExpectsCriteria.cs" company="Marimer LLC">
3// Copyright (c) Marimer LLC. All rights reserved.
4// Website: https://cslanet.com
5// </copyright>
6// <summary>no summary</summary>
7//-----------------------------------------------------------------------
8
9using System.Linq;
10using Csla.Rules;
11
13{
15 {
16 public AuthRuleExpectsCriteria(AuthorizationActions action) : base(action)
17 {
18 }
19
20 protected override void Execute(IAuthorizationContext context)
21 {
22 context.HasPermission = context.Criteria?.FirstOrDefault() is PermissionRootWithCriteria.Criteria;
23 }
24 }
25}
Base class providing basic authorization rule implementation.
override void Execute(IAuthorizationContext context)
Authorization rule implementation.
Implemented by objects which provide context information to an authorization rule when it is invoked.
bool HasPermission
Gets or sets a value indicating whether the current user has permission to perform the requested acti...
object[] Criteria
Gets an object which is the criteria specified in the data portal call, if any.
AuthorizationActions
Authorization actions.