public void RemoveUserGroupRef(int tenant, Guid userId, Guid groupId, UserGroupRefType refType, bool immediate) { var where = Exp.Eq("userid", userId.ToString()) & Exp.Eq("groupid", groupId.ToString()) & Exp.Eq("ref_type", (int)refType); var i = immediate ? Delete("core_usergroup", tenant).Where(where) : (ISqlInstruction)Update("core_usergroup", tenant).Where(where).Set("removed", true).Set("last_modified", DateTime.UtcNow); var u = Update("core_user", tenant).Set("last_modified", DateTime.UtcNow).Where("id", userId.ToString()); ExecBatch(i, u); }
public void RemoveUserGroupRef(int tenant, Guid userId, Guid groupId, UserGroupRefType refType) { Service.RemoveUserGroupRef(tenant, userId, groupId, refType); var r = new UserGroupRef(userId, groupId, refType) { Tenant = tenant }; CacheUserGroupRefItem.Publish(r, CacheNotifyAction.Remove); }
public static string CreateKey(int tenant, Guid userId, Guid groupId, UserGroupRefType refType) { return(tenant.ToString() + userId.ToString("N") + groupId.ToString("N") + ((int)refType).ToString()); }
public UserGroupRef(Guid userId, Guid groupId, UserGroupRefType refType) { UserId = userId; GroupId = groupId; RefType = refType; }
public void RemoveUserGroupRef(int tenant, Guid userId, Guid groupId, UserGroupRefType refType) { RemoveUserGroupRef(tenant, userId, groupId, refType, false); }
public void RemoveUserGroupRef(int tenant, Guid userId, Guid groupId, UserGroupRefType refType) { service.RemoveUserGroupRef(tenant, userId, groupId, refType); InvalidateCache(); }
public static string CreateKey(int tenant, Guid userId, Guid groupId, UserGroupRefType refType) { return tenant.ToString() + userId.ToString("N") + groupId.ToString("N") + ((int)refType).ToString(); }