SPC020611: Do not define 'FileIOPermission' with 'Unrestricted=true'

The CAS Policy for System.Security.Permissions.FileIOPermission with setting 'Unrestricted=true' is not allowed. This means read and write permission to all locations on the SharePoint system. Limit the permission to certain folders, e.g. TEMP.

TypeName: DoNotDefineUnrestrictedFileIOPermission
CheckId: SPC020611
Severity: Error
Type: PermissionSetDefinition
Resolution

Remove permission 'FileIOPermission' with setting 'Unrestricted=true'.

Bad Sample:

<Solution xmlns="http://schemas.microsoft.com/sharepoint/">
  <CodeAccessSecurity>
    <PolicyItem>
      <PermissionSet class="NamedPermissionSet" version="1">
      ...
        <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=Neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="True" />
      ...
      </PermissionSet>
    <PolicyItem>
  <CodeAccessSecurity>
</Solution>

Links

comments powered by Disqus