system\security\codeaccesssecurityengine.cs (3)
106private static void ThrowSecurityException(RuntimeAssembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandleInternal rmh, SecurityAction action, Object demand, IPermission permThatFailed)
127private static void ThrowSecurityException(Object assemblyOrString, PermissionSet granted, PermissionSet refused, RuntimeMethodHandleInternal rmh, SecurityAction action, Object demand, IPermission permThatFailed)
205IPermission permThatFailed = null;
system\security\permissionset.cs (116)
239IPermission perm = obj as IPermission;
330IPermission perm = (IPermission)enumerator.Current;
365internal IPermission GetPermission(int index)
372IPermission perm = obj as IPermission;
387internal IPermission GetPermission(PermissionToken permToken)
395internal IPermission GetPermission( IPermission perm )
404public IPermission GetPermission(Type permClass)
409protected virtual IPermission GetPermissionImpl(Type permClass)
418public IPermission SetPermission(IPermission perm)
424protected virtual IPermission SetPermissionImpl(IPermission perm)
440IPermission currPerm = GetPermission( permToken.m_index );
449public IPermission AddPermission(IPermission perm)
454protected virtual IPermission AddPermissionImpl(IPermission perm)
472return (IPermission) Activator.CreateInstance(perm_type, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public, null, objs, null );
476IPermission currPerm = GetPermission(permToken.m_index);
482IPermission ip_union = currPerm.Union(perm);
493private IPermission RemovePermission( int index )
495IPermission perm = GetPermission(index);
498return (IPermission)m_permSet.RemoveItem( index ); // this cast is safe because the call to GetPermission will guarantee it is an IPermission
502public IPermission RemovePermission(Type permClass)
507protected virtual IPermission RemovePermissionImpl(Type permClass)
548internal bool IsSubsetOfHelper(PermissionSet target, IsSubsetOfType type, out IPermission firstPermThatFailed, bool ignoreNonCas)
580IPermission thisPerm = this.GetPermission(i);
584IPermission targetPerm = target.GetPermission(i);
636IPermission perm;
640internal bool CheckDemand(PermissionSet target, out IPermission firstPermThatFailed)
645internal bool CheckPermitOnly(PermissionSet target, out IPermission firstPermThatFailed)
652IPermission perm;
656internal bool CheckDeny(PermissionSet deniedSet, out IPermission firstPermThatFailed)
690if(enumThat.Current is IPermission)
802IPermission thisPerm = thisObj as IPermission;
808IPermission otherPerm = otherObj as IPermission;
918IPermission intersectPerm;
974IPermission thisPerm = thisObj as IPermission;
980IPermission otherPerm = otherObj as IPermission;
1079IPermission intersectPerm;
1140IPermission thisPerm = thisObj as IPermission;
1146IPermission otherPerm = otherObj as IPermission;
1211IPermission unionPerm;
1266IPermission thisPerm = thisObj as IPermission;
1272IPermission otherPerm = otherObj as IPermission;
1343IPermission unionPerm;
1377IPermission deniedPerm = denied.m_permSet.GetItem(i) as IPermission;
1381IPermission thisPerm = this.m_permSet.GetItem(i) as IPermission;
1398internal bool Contains(IPermission perm)
1412IPermission thisPerm = GetPermission(token.m_index);
1444IPermission thisPerm = (IPermission)this.m_permSet.GetItem( i );
1445IPermission otherPerm = (IPermission)other.m_permSet.GetItem( i );
1486IPermission perm = (IPermission)this.m_permSet.GetItem( i );
1532IPermission currPerm = GetPermission(i);
1577internal IPermission GetFirstPerm()
1582return enumerator.Current as IPermission;
1651IPermission perm = obj as IPermission;
1797token = PermissionToken.GetToken( (IPermission)objectToInsert );
1808IPermission ip = CreatePerm( elem );
1833IPermission permInSlot;
1835if (this.m_permSet.GetItem( token.m_index ) is IPermission)
1836permInSlot = (IPermission)this.m_permSet.GetItem( token.m_index );
1840if (objectToInsert is IPermission)
1841objectToInsert = ((IPermission)objectToInsert).Union( permInSlot );
1846if(m_Unrestricted && objectToInsert is IPermission)
1904token = PermissionToken.GetToken( (IPermission)objectToInsert );
1916IPermission ip = CreatePerm( doc.GetElement( childIndex, true ) );
1936IPermission permInSlot = null;
1942if (this.m_permSet.GetItem( token.m_index ) is IPermission)
1943permInSlot = (IPermission)this.m_permSet.GetItem( token.m_index );
1950if (objectToInsert is IPermission)
1951objectToInsert = permInSlot.Union((IPermission)objectToInsert);
1956if(m_Unrestricted && objectToInsert is IPermission)
1980private IPermission CreatePerm(Object obj)
1985internal static IPermission CreatePerm(Object obj, bool ignoreTypeLoadFailures)
1995IPermission finalPerm = null;
2003IPermission tempPerm = CreatePerm( (SecurityElement)enumerator.Current, ignoreTypeLoadFailures);
2016IPermission tempPerm = CreatePerm( (SecurityElement)enumerator.Current, ignoreTypeLoadFailures);
2033IPermission tempPerm = CreatePerm( (SecurityElement)enumerator.Current, ignoreTypeLoadFailures );
2064IPermission tempPerm = CreatePerm( (SecurityElement)enumerator.Current, ignoreTypeLoadFailures );
2103internal IPermission CreatePermission(Object obj, int index)
2105IPermission perm = CreatePerm(obj);
2173IPermission perm = (IPermission)enumerator.Current;
2201if (obj is IPermission)
2204elTrunk.AddChild( ((IPermission)obj).ToXml() );
2284IPermission perm = enumerator.Current as IPermission;
2318IPermission perm = (IPermission)enumerator.Current;
2380private static void MergePermission(IPermission perm, bool separateCasFromNonCas, ref PermissionSet casPset, ref PermissionSet nonCasPset)
2392IPermission oldPerm = casPset.GetPermission(perm);
2393IPermission unionPerm = casPset.AddPermission(perm);
2401IPermission oldPerm = nonCasPset.GetPermission(perm);
2402IPermission unionPerm = nonCasPset.AddPermission( perm );
2443IPermission perm = (IPermission)enumerator.Current;
2455IPermission perm = ((SecurityAttribute)attrs[i]).CreatePermission();
system\security\securityexception.cs (6)
77internal static Exception MakeSecurityException(AssemblyName asmName, Evidence asmEvidence, PermissionSet granted, PermissionSet refused, RuntimeMethodHandleInternal rmh, SecurityAction action, Object demand, IPermission permThatFailed)
97if(demand != null && demand is IPermission)
272public SecurityException(string message, AssemblyName assemblyName, PermissionSet grant, PermissionSet refused, MethodInfo method, SecurityAction action, Object demanded, IPermission permThatFailed, Evidence evidence)
306public SecurityException(string message, Object deny, Object permitOnly, MethodInfo method, Object demanded, IPermission permThatFailed)
373public IPermission FirstPermissionThatFailed
379return (IPermission)XMLUtil.XmlStringToSecurityObject(m_permissionThatFailed);