コード例 #1
0
            public void WhenUserHasAllStandardRights()
            {
                var rights = new IdentityRights { Identity = CurrentIdentity, Rights = FileSystemRights.FullControl };
                var descriptor = CreateSecurityDescriptor(new[] { rights });
                var access = EffectiveAccess.ComputeAccess(descriptor, CurrentIdentity);

                Assert.True(access.HasFlag(ACCESS_MASK.STANDARD_RIGHTS_ALL));
            }
コード例 #2
0
            public void WhenGroupIsDeniedWrite()
            {
                IdentityRights rights = new IdentityRights {Identity = Group, Rights = FileSystemRights.FullControl};
                var descriptor = CreateSecurityDescriptor(null, denyRights: new[] { rights });
                var access = EffectiveAccess.ComputeAccess(descriptor, CurrentIdentity);

                Assert.False(access.HasFlag(ACCESS_MASK.STANDARD_RIGHTS_ALL));
            }
コード例 #3
0
            public void WhenGroupIsDeniedWrite()
            {
                IdentityRights rights = new IdentityRights {
                    Identity = Group, Rights = FileSystemRights.FullControl
                };
                var descriptor = CreateSecurityDescriptor(null, denyRights: new[] { rights });
                var access     = EffectiveAccess.ComputeAccess(descriptor, CurrentIdentity);

                Assert.False(access.HasFlag(ACCESS_MASK.STANDARD_RIGHTS_ALL));
            }
コード例 #4
0
            public void WhenGroupHasAllStandardRights()
            {
                var rights = new IdentityRights {
                    Identity = Group, Rights = FileSystemRights.FullControl
                };
                var descriptor = CreateSecurityDescriptor(new[] { rights });
                var access     = EffectiveAccess.ComputeAccess(descriptor, CurrentIdentity);

                Assert.True(access.HasFlag(ACCESS_MASK.STANDARD_RIGHTS_ALL));
            }