示例#1
0
        public void CanAuthorizeStaffMemberWithSingleRole()
        {
            var staffMember = new StaffMember {
                Roles = RoleType.Administrator
            };

            Assert.That(staffMember.IsAuthorizedAs(RoleType.Administrator));
            Assert.That(!staffMember.IsAuthorizedAs(RoleType.SupportStaff));
        }
示例#2
0
        public void CanAuthorizeStaffMemberWithMultipleRoles()
        {
            var staffMember = new StaffMember {
                Roles = RoleType.Manager | RoleType.SupportStaff
            };

            Assert.That(staffMember.IsAuthorizedAs(RoleType.Manager));
            Assert.That(staffMember.IsAuthorizedAs(RoleType.SupportStaff));
            Assert.That(!staffMember.IsAuthorizedAs(RoleType.Administrator));
        }