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));
            }
            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));
            }