protected override IQueryable <IBusinessObject> CreateQuery( BaseSecurityManagerObject referencingObject, IBusinessObjectReferenceProperty property, TenantConstraint tenantConstraint, DisplayNameConstraint displayNameConstraint) { return(Tenant.FindAll().Apply(displayNameConstraint).Cast <IBusinessObject>()); }
protected override IQueryable <IBusinessObject> CreateQuery( BaseSecurityManagerObject referencingObject, IBusinessObjectReferenceProperty property, TenantConstraint tenantConstraint, DisplayNameConstraint displayNameConstraint) { ArgumentUtility.CheckNotNull("tenantConstraint", tenantConstraint); return(Group.FindByTenant(tenantConstraint.Value).Apply(displayNameConstraint).Cast <IBusinessObject>()); }
private IQueryable <IBusinessObject> FindPossibleSubstitutedRoles( Substitution substitution, IBusinessObjectReferenceProperty property, TenantConstraint tenantConstraint, DisplayNameConstraint displayNameConstraint) { ArgumentUtility.CheckNotNull("substitution", substitution); if (substitution.SubstitutedUser == null) { return(Enumerable.Empty <IBusinessObject>().AsQueryable()); } return(substitution.SubstitutedUser.Roles.Cast <IBusinessObject>().AsQueryable()); }
public override void SetUp() { base.SetUp(); _searchService = new UserPropertyTypeSearchService(); IBusinessObjectClass roleClass = BindableObjectProviderTestHelper.GetBindableObjectClass(typeof(Role)); _property = (IBusinessObjectReferenceProperty)roleClass.GetPropertyDefinition("User"); Assert.That(_property, Is.Not.Null); var user = User.FindByUserName("group0/user1"); Assert.That(user, Is.Not.Null); _tenantConstraint = new TenantConstraint(user.Tenant.GetHandle()); }
public override void SetUp() { base.SetUp(); _searchService = new GroupPropertyTypeSearchService(); IBusinessObjectClass roleClass = BindableObjectProviderTestHelper.GetBindableObjectClass(typeof(Role)); _property = (IBusinessObjectReferenceProperty)roleClass.GetPropertyDefinition("Group"); Assert.That(_property, Is.Not.Null); var group = Group.FindByUnqiueIdentifier("UID: group0"); Assert.That(group, Is.Not.Null); _tenantConstraint = new TenantConstraint(group.Tenant.GetHandle()); }