Esempio n. 1
0
        public void CanMapReadPermission(Permission expectedPermission, bool expectedResult)
        {
            var map = new PermissionMap {
                Permissions = Permission.Read, Roles = new[] { "rolename" }
            };

            Assert.That(map.MapsTo(expectedPermission), Is.EqualTo(expectedResult));
            Assert.That(map.Authorizes(user, item, expectedPermission), Is.EqualTo(expectedResult));
        }
Esempio n. 2
0
        public void CanMapFullPermission(Permission expectedPermission)
        {
            var map = new PermissionMap {
                Permissions = Permission.Full, Roles = new[] { "rolename" }
            };

            Assert.That(map.MapsTo(expectedPermission), Is.True);
            Assert.That(map.Authorizes(user, item, expectedPermission), Is.True);
        }