LogicOperatorPermissionService class

namespace: Serenity.Web   assemblySerenity.Net.Core

Adds AND OR operator support to any IPermissionService implementation

public class LogicOperatorPermissionService : IPermissionService

Public Members

name description
LogicOperatorPermissionService(…) Creates a new LogicOperatorPermissionService wrapping passed IPermissionService
HasPermission(…) Returns true if user has specified permission


Register this class in your application start, to allow !, |, &, () operators in your permission services, e.g.

registrar.RegisterInstance<IPermissionService>(new LogicOperatorPermissionService(new MyPermissionService()))

See Also