private PermissionSet ResolvePolicy(Evidence evidence,
                                            PermissionSet reqdPset,
                                            PermissionSet optPset,
                                            PermissionSet denyPset,
                                            out PermissionSet denied,
                                            out int grantedIsUnrestricted,
                                            bool checkExecutionPermission)
        {
            CodeAccessPermission.AssertAllPossible();

            PermissionSet granted = ResolvePolicy(evidence,
                                                  reqdPset,
                                                  optPset,
                                                  denyPset,
                                                  out denied,
                                                  checkExecutionPermission);

            if (granted != null && granted.IsUnrestricted() && (denied == null || denied.IsEmpty()))
            {
                grantedIsUnrestricted = 1;
            }
            else
            {
                grantedIsUnrestricted = 0;
            }

            return(granted);
        }
        private PermissionSet ResolvePolicy(Evidence evidence,
                                            PermissionSet reqdPset,
                                            PermissionSet optPset,
                                            PermissionSet denyPset,
                                            out PermissionSet denied,
                                            out int securitySpecialFlags,
                                            bool checkExecutionPermission)
        {
            CodeAccessPermission.AssertAllPossible();

            PermissionSet granted = ResolvePolicy(evidence,
                                                  reqdPset,
                                                  optPset,
                                                  denyPset,
                                                  out denied,
                                                  checkExecutionPermission);

            securitySpecialFlags = SecurityManager.GetSpecialFlags(granted, denied);
            return(granted);
        }