Do not define 'SecurityPermission' with 'Unrestricted=true' |
The CAS Policy for System.Security.Permissions.SecurityPermission with setting 'Unrestricted=true' is not allowed.
CheckId | SPC020613 |
---|---|
TypeName | DoNotDefineUnrestrictedSecurityPermission |
Severity | Error |
Type | PermissionSet |
Remove permission 'SecurityPermission' with setting 'Unrestricted=true' or change to 'Flags=Execution'.
Bad Practice
<Solution xmlns="http://schemas.microsoft.com/sharepoint/">
<CodeAccessSecurity>
<PolicyItem>
<PermissionSet class="NamedPermissionSet" version="1">
...
<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="True" />
...
</PermissionSet>
<PolicyItem>
<CodeAccessSecurity>
</Solution></code
Good Practice
<CodeAccessSecurity>
<PolicyItem>
<PermissionSet class="NamedPermissionSet" version="1">
...
<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="True" />
...
</PermissionSet>
<PolicyItem>
<CodeAccessSecurity>
</Solution></code
Good Practice
<PermissionSet class="NamedPermissionSet" version="1">
...
<IPermission class="SecurityPermission" version="1" Flags="Execution" />
...
</PermissionSet>
...
<IPermission class="SecurityPermission" version="1" Flags="Execution" />
...
</PermissionSet>
Disclaimer: The views and opinions expressed in this documentation and in SPCAF do not necessarily reflect the opinions and recommendations of Microsoft or any member of Microsoft. SPCAF and RENCORE are registered trademarks of Rencore. All other trademarks, service marks, collective marks, copyrights, registered names, and marks used or cited by this documentation are the property of their respective owners.