本文整理汇总了C#中InheritanceFlags类的典型用法代码示例。如果您正苦于以下问题:C# InheritanceFlags类的具体用法?C# InheritanceFlags怎么用?C# InheritanceFlags使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InheritanceFlags类属于命名空间,在下文中一共展示了InheritanceFlags类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AccessRuleFactory
public override AccessRule AccessRuleFactory (IdentityReference identityReference,
int accessMask, bool isInherited,
InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags,
AccessControlType type)
{
return new PipeAccessRule (identityReference, (PipeAccessRights)accessMask, type);
}
示例2: AccessRuleFactory
public override sealed AccessRule AccessRuleFactory (IdentityReference identityReference, int accessMask,
bool isInherited, InheritanceFlags inheritanceFlags,
PropagationFlags propagationFlags, AccessControlType type)
{
return new FileSystemAccessRule (identityReference, (FileSystemRights) accessMask, isInherited,
inheritanceFlags, propagationFlags, type);
}
示例3: GetEffectiveInheritanceFlags
internal static ActiveDirectorySecurityInheritance GetEffectiveInheritanceFlags(InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags)
{
ActiveDirectorySecurityInheritance activeDirectorySecurityInheritance = ActiveDirectorySecurityInheritance.None;
if ((inheritanceFlags & InheritanceFlags.ContainerInherit) != InheritanceFlags.None)
{
PropagationFlags propagationFlag = propagationFlags;
if (propagationFlag == PropagationFlags.None)
{
activeDirectorySecurityInheritance = ActiveDirectorySecurityInheritance.All;
return activeDirectorySecurityInheritance;
}
else if (propagationFlag == PropagationFlags.NoPropagateInherit)
{
activeDirectorySecurityInheritance = ActiveDirectorySecurityInheritance.SelfAndChildren;
return activeDirectorySecurityInheritance;
}
else if (propagationFlag == PropagationFlags.InheritOnly)
{
activeDirectorySecurityInheritance = ActiveDirectorySecurityInheritance.Descendents;
return activeDirectorySecurityInheritance;
}
else if (propagationFlag == (PropagationFlags.NoPropagateInherit | PropagationFlags.InheritOnly))
{
activeDirectorySecurityInheritance = ActiveDirectorySecurityInheritance.Children;
return activeDirectorySecurityInheritance;
}
throw new ArgumentException("propagationFlags");
}
return activeDirectorySecurityInheritance;
}
示例4: base
public FileSystemAuditRule
(String identity, FileSystemRights fileSystemRights,
InheritanceFlags inheritanceFlags,
PropagationFlags propagationFlags, AuditFlags auditFlags)
: base(IdentityReference.IdentityFromName(identity),
(int)fileSystemRights, false, inheritanceFlags,
propagationFlags, auditFlags) {}
示例5: AddAccess
public void AddAccess(AccessControlType accessType, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags)
{
base.CheckAccessType(accessType);
base.CheckFlags(inheritanceFlags, propagationFlags);
this.everyOneFullAccessForNullDacl = false;
base.AddQualifiedAce(sid, (accessType == AccessControlType.Allow) ? AceQualifier.AccessAllowed : AceQualifier.AccessDenied, accessMask, GenericAce.AceFlagsFromInheritanceFlags(inheritanceFlags, propagationFlags), ObjectAceFlags.None, Guid.Empty, Guid.Empty);
}
示例6: base
public RegistryAuditRule
(String identity, RegistryRights registryRights,
InheritanceFlags inheritanceFlags,
PropagationFlags propagationFlags, AuditFlags auditFlags)
: base(IdentityReference.IdentityFromName(identity),
(int)registryRights, false, inheritanceFlags,
propagationFlags, auditFlags) {}
示例7: AuditRuleFactory
public override sealed AuditRule AuditRuleFactory (IdentityReference identityReference,
int accessMask, bool isInherited,
InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags,
AuditFlags flags)
{
return new PipeAuditRule (identityReference, (PipeAccessRights)accessMask, flags);
}
示例8: AccessRule
protected AccessRule (IdentityReference identity,
int accessMask,
bool isInherited,
InheritanceFlags inheritanceFlags,
PropagationFlags propagationFlags,
AccessControlType type)
: base (identity, accessMask, isInherited,
inheritanceFlags, propagationFlags)
{
if (!(identity is SecurityIdentifier)) {
throw new ArgumentException ("identity");
}
if (type < AccessControlType.Allow ||
type > AccessControlType.Deny) {
throw new ArgumentException ("type");
}
if (accessMask == 0) {
/* FIXME: check inheritance and
* propagation flags too
*/
throw new ArgumentOutOfRangeException ();
}
this.type = type;
}
示例9: base
public FileSystemAccessRule
(String identity, FileSystemRights fileSystemRights,
InheritanceFlags inheritanceFlags,
PropagationFlags propagationFlags, AccessControlType type)
: base(IdentityReference.IdentityFromName(identity),
(int)fileSystemRights, false, inheritanceFlags,
propagationFlags, type) {}
示例10: base
public RegistryAccessRule
(String identity, RegistryRights registryRights,
InheritanceFlags inheritanceFlags,
PropagationFlags propagationFlags, AccessControlType type)
: base(IdentityReference.IdentityFromName(identity),
(int)registryRights, false, inheritanceFlags,
propagationFlags, type) {}
示例11: AddDirectorySecurity
private static void AddDirectorySecurity(string folderName, string account, FileSystemRights rights, InheritanceFlags inheritance, PropagationFlags propogation, AccessControlType controlType)
{
DirectoryInfo directoryInfo = new DirectoryInfo(folderName);
DirectorySecurity accessControl = directoryInfo.GetAccessControl();
accessControl.AddAccessRule(new FileSystemAccessRule(account, rights, inheritance, propogation, controlType));
directoryInfo.SetAccessControl(accessControl);
}
示例12: TestRemoveAudit
private static bool TestRemoveAudit(SystemAcl systemAcl, RawAcl rawAcl, AuditFlags auditFlag, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, bool removePossible)
{
bool result = true;
bool isRemoved = false;
byte[] sAclBinaryForm = null;
byte[] rAclBinaryForm = null;
isRemoved = systemAcl.RemoveAudit(auditFlag, sid, accessMask, inheritanceFlags, propagationFlags);
if ((isRemoved == removePossible) &&
(systemAcl.Count == rawAcl.Count) &&
(systemAcl.BinaryLength == rawAcl.BinaryLength))
{
sAclBinaryForm = new byte[systemAcl.BinaryLength];
rAclBinaryForm = new byte[rawAcl.BinaryLength];
systemAcl.GetBinaryForm(sAclBinaryForm, 0);
rawAcl.GetBinaryForm(rAclBinaryForm, 0);
if (!Utils.IsBinaryFormEqual(sAclBinaryForm, rAclBinaryForm))
result = false;
//redundant index check
for (int i = 0; i < systemAcl.Count; i++)
{
if (!Utils.IsAceEqual(systemAcl[i], rawAcl[i]))
{
result = false;
break;
}
}
}
else
result = false;
return result;
}
示例13: TestAddAccess
private static bool TestAddAccess(DiscretionaryAcl discretionaryAcl, RawAcl rawAcl, AccessControlType accessControlType, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags)
{
bool result = true;
byte[] dAclBinaryForm = null;
byte[] rAclBinaryForm = null;
discretionaryAcl.AddAccess(accessControlType, sid, accessMask, inheritanceFlags, propagationFlags);
if (discretionaryAcl.Count == rawAcl.Count &&
discretionaryAcl.BinaryLength == rawAcl.BinaryLength)
{
dAclBinaryForm = new byte[discretionaryAcl.BinaryLength];
rAclBinaryForm = new byte[rawAcl.BinaryLength];
discretionaryAcl.GetBinaryForm(dAclBinaryForm, 0);
rawAcl.GetBinaryForm(rAclBinaryForm, 0);
if (!Utils.IsBinaryFormEqual(dAclBinaryForm, rAclBinaryForm))
result = false;
//redundant index check
for (int i = 0; i < discretionaryAcl.Count; i++)
{
if (!Utils.IsAceEqual(discretionaryAcl[i], rawAcl[i]))
{
result = false;
break;
}
}
}
else
result = false;
return result;
}
示例14: AuthorizationRule
protected internal AuthorizationRule (IdentityReference identity,
int accessMask, bool isInherited,
InheritanceFlags inheritanceFlags,
PropagationFlags propagationFlags)
{
if (!(identity is SecurityIdentifier) && !(identity is NTAccount))
throw new ArgumentException ("identity");
// Unit testing showed that MS.NET 4.0 actually throws ArgumentException
// for accessMask == 0, not the ArgumentOutOfRangeException specified.
if (accessMask == 0)
throw new ArgumentException ("accessMask");
if (0 != (inheritanceFlags & ~(InheritanceFlags.ContainerInherit|InheritanceFlags.ObjectInherit)))
throw new ArgumentOutOfRangeException ();
if (0 != (propagationFlags & ~(PropagationFlags.NoPropagateInherit|PropagationFlags.InheritOnly)))
throw new ArgumentOutOfRangeException ();
this.identity = identity;
this.accessMask = accessMask;
this.isInherited = isInherited;
this.inheritanceFlags = inheritanceFlags;
this.propagationFlags = propagationFlags;
}
示例15: AuditRuleFactory
public virtual AuditRule AuditRuleFactory (IdentityReference identityReference, int accessMask,
bool isInherited, InheritanceFlags inheritanceFlags,
PropagationFlags propagationFlags, AuditFlags flags,
Guid objectType, Guid inheritedObjectType)
{
throw GetNotImplementedException ();
}