About the use of MAC with Environment Attribute

Step 1
Create a method: _EnvAttr_WorkHours
The code is:
//MethodTemplateName=CSharp:Aras.Server.Core.AccessControl.EnvironmentAttributeMethod;
var isWorkDay = 1==1;
attribute.SetValue(isWorkHours);//Always return true value

Step 2
Create an environment attribute
Name: workhours
Type: Boolean
Get Value Method: _EnvAttr_WorkHours

Step 3
Create a MAC Policies
Name: _CheckWorkHours
Applied To: Document
Condition Name: CheckWorkHours
Condition: $workhours = 1
Policy Rules: All configured as CheckWorkHours (except Warning Discover)

Test:
Document can work normally, but the associated File prompts that the permission is insufficient.



Hope to get your help, thank you!