public void IsOrganizationAdminReturnsTrueWhenUserIsOrganizationAdmin() { var principal = new ClaimsPrincipal(new ClaimsIdentity(new[] { new Claim(AllReady.Security.ClaimTypes.UserType, "OrgAdmin") })); Assert.False(principal.IsOrganizationAdmin()); }
public void IsOrganizationAdminReturnsFalseWhenUserDoesNotHaveOrganizationId() { var principal = new ClaimsPrincipal(); Assert.False(principal.IsOrganizationAdmin()); }
public void WhenOrganizationIdIsSetNonOrganizationAdminShouldNotBeAdminOfOrganization() { var principal = new ClaimsPrincipal(new ClaimsIdentity(new[] { new Claim(AllReady.Security.ClaimTypes.Organization, "2") })); Assert.False(principal.IsOrganizationAdmin(2)); }
public void WhenOrganizationIdIsSetOrganizationAdminShouldBeAdminOfOrganization() { var principal = new ClaimsPrincipal(new ClaimsIdentity(new[] { new Claim(AllReady.Security.ClaimTypes.UserType, "OrgAdmin"), new Claim(AllReady.Security.ClaimTypes.Organization, "2") })); Assert.True(principal.IsOrganizationAdmin(2)); }
public void WhenOrganizationIdIsNotSetOrganizationAdminShouldNotBeAdminOfOrganization() { var principal = new ClaimsPrincipal(new ClaimsIdentity(new[] { new Claim(AllReady.Security.ClaimTypes.UserType, "OrgAdmin") })); Assert.False(principal.IsOrganizationAdmin(1)); }
public void SiteAdminShouldBeAdminOfAnyOrganizationId() { var principal = new ClaimsPrincipal(new ClaimsIdentity(new[] { new Claim(AllReady.Security.ClaimTypes.UserType, "SiteAdmin") })); Assert.True(principal.IsOrganizationAdmin(12)); }