Exemplo n.º 1
0
        public void SiteAdminShouldBeAdminOfAnyTenantId()
        {
            ClaimsPrincipal principal = new ClaimsPrincipal(
                new ClaimsIdentity(
                        new[]
                        {
                            new Claim(AllReady.Security.ClaimTypes.UserType, "SiteAdmin")
                        }
                    ));

            Assert.True(principal.IsTenantAdmin(12));
        }
Exemplo n.º 2
0
        public void WhenTenantIdIsSetTenantAdminShouldNotBeAdminOfAnotherTenant()
        {
            ClaimsPrincipal principal = new ClaimsPrincipal(
                new ClaimsIdentity(
                        new[]
                        {
                            new Claim(AllReady.Security.ClaimTypes.UserType, "TenantAdmin"),
                            new Claim(AllReady.Security.ClaimTypes.Tenant, "2")
                        }
                    ));

            Assert.False(principal.IsTenantAdmin(1));
        }