public static void AuthorizeOrganizationUser(int[] organizationIds) { var userId = ((IBusinessIdentity)Csla.ApplicationContext.User.Identity).UserId; OrganizationUserRepository.AuthorizeOrganizationUser(organizationIds, userId); }
public static OrganizationUserInfoList OrganizationUserFetchInfoList(int organizationId) { OrganizationUserRepository.AuthorizeOrganizationUser(organizationId); return(OrganizationUserInfoList.FetchOrganizationUserInfoList( new OrganizationUserMemberDataCriteria { OrganizationId = organizationId })); }
public static bool OrganizationUserDelete(OrganizationUser organizationUser) { OrganizationUserRepository.AuthorizeOrganizationUser(organizationUser.OrganizationId); if (OrganizationUserRepository.OrganizationUserFetch( organizationUser.OrganizationId, organizationUser.UserId).RoleId == (int)Role.Owner) { throw new NotSupportedException("You cannot delete the owner of a organization"); } OrganizationUser.DeleteOrganizationUser( new OrganizationUserMemberDataCriteria { OrganizationUserMemberId = organizationUser.OrganizationUserMemberId }); return(true); }
public static OrganizationUser OrganizationUserSave(OrganizationUser organizationUser) { if (!organizationUser.IsValid) { return(organizationUser); } OrganizationUserRepository.AuthorizeOrganizationUser(organizationUser.OrganizationId); OrganizationUser result; if (organizationUser.IsNew) { result = OrganizationUserRepository.OrganizationUserInsert(organizationUser); } else { result = OrganizationUserRepository.OrganizationUserUpdate(organizationUser); } return(result); }