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
-
objectEnvironmentPermissionsLogic
- Implements
Constructors
EnvironmentPermissionsLogic(ILog)
Reusable Environment-Permissions logic, to be used by the specific implementation.
public EnvironmentPermissionsLogic(ILog parentLog)
Parameters
parentLogILog
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
grantsList<Grants>The list of grants to check.
optionsEnvironmentPermissionOptionsThe environment permission options.
userIsModuleAdminFunc<bool>Function to check if the user is a module admin.
userIsModuleEditorFunc<bool>Function to check if the user is a module editor.
Returns
- bool
True if the environment approves the grants, otherwise false.