public ContentResult UnAssignMemberRoleByID(long MemberID, long[] UnAssignRoles) { Member member = Members.GetBy(MemberID); foreach (long RoleID in UnAssignRoles) { Role role = Roles.GetBy(RoleID); // Ignore admin in admins role if (member.Name.ToLower() == "admin" && role.Name.ToLower() == "admins") { } else { MemberRole memberrole = new MemberRole(); memberrole.MemberID = MemberID; memberrole.RoleID = RoleID; memberrole.Delete(); } } String Json = Roles.JsonCollection(Roles.GetByMember(MemberID)); return(Content(Json, TypeJson)); }
public ContentResult GetMemberRolesByEmail(String MemberEmail) { Member _Member = Members.GetByEmail(MemberEmail); String Json = Roles.JsonCollection(Roles.GetByMember(_Member.MemberID)); return(Content(Json, TypeJson)); }
public ContentResult AssignRoleMemberByName(string Email, string[] AssignRoles) { Member Member = Members.GetByEmail(Email); foreach (string _roleID in AssignRoles) { Role Role = Roles.GetBy(_roleID); if (Role.RoleID > 0) { MemberRole memberrole = new MemberRole(); memberrole.MemberID = Member.MemberID; memberrole.RoleID = Role.RoleID; memberrole.Save(); } } String Json = Roles.JsonCollection(Roles.GetByMember(Member.MemberID)); return(Content(Json, TypeJson)); }
public ContentResult UnAssignMemberRolesByName(string Email, string[] UnAssignRoles) { Member Member = Members.GetByEmail(Email); foreach (string RoleName in UnAssignRoles) { Role Role = Roles.GetBy(RoleName); // Ignore admin in admins role if (Member.Name.ToLower() == "admin" && Role.Name.ToLower() == "admins") { } else { MemberRole memberrole = new MemberRole(); memberrole.MemberID = Member.MemberID; memberrole.RoleID = Role.RoleID; memberrole.Delete(); } } String Json = Roles.JsonCollection(Roles.GetByMember(Member.MemberID)); return(Content(Json, TypeJson)); }
public ContentResult GetMemberRolesByID(long MemberID) { String Json = Roles.JsonCollection(Roles.GetByMember(MemberID)); return(Content(Json, TypeJson)); }
public ContentResult GetRoles() { String Json = Roles.JsonCollection(Roles.Get()); return(Content(Json, TypeJson)); }