Table of Contents

Class EnvironmentPermissionsLogic

Namespace
ToSic.Eav.Environment.Sys.Permissions
Assembly
ToSic.Eav.Context.dll

Reusable Environment-Permissions logic, to be used by the specific implementation.

[InternalApi_DoNotUse_MayChangeWithoutNotice]
public class EnvironmentPermissionsLogic : HelperBase, IHasLog
Inheritance
object
EnvironmentPermissionsLogic
Implements

Constructors

EnvironmentPermissionsLogic(ILog)

Reusable Environment-Permissions logic, to be used by the specific implementation.

public EnvironmentPermissionsLogic(ILog parentLog)

Parameters

parentLog ILog

Methods

EnvironmentAllows(List<Grants>, EnvironmentPermissionOptions, Func<bool>, Func<bool>)

This should evaluate the grants and decide if the environment approves any of these grants. Note that in many cases the implementation will simply check if the environment provides edit permissions, but it can really check the grants required and compare each one with the environment.

public bool EnvironmentAllows(List<Grants> grants, EnvironmentPermissionOptions options, Func<bool> userIsModuleAdmin, Func<bool> userIsModuleEditor)

Parameters

grants List<Grants>

The list of grants to check.

options EnvironmentPermissionOptions

The environment permission options.

userIsModuleAdmin Func<bool>

Function to check if the user is a module admin.

userIsModuleEditor Func<bool>

Function to check if the user is a module editor.

Returns

bool

True if the environment approves the grants, otherwise false.