Refactor the connections between users and machines:
now a user can have many machines, and a machine can have many users.
requests like :
Machine.findOne({ user: null });
is replaced by:
Machine.find().populate('users').then((machines) => {
lodash.remove(machines, (machine) => machine.users.lentgh === 0 )
});
because sails can't do it easier.
Users are assigned in priority on machines who have already been assigned with other users, and don't have reached the users limit.
Little modification of plaza, and refactoring of fake plaza:
Plaza now fork it self with the Administrator session.
All requests to plaza are made through admin session, so desktop is available, but launching other applications will resolve in no application launch for the user, the application is launch on admin session.
Coverage increased (+0.9%) to 70.988% when pulling 618347f67ee1276df28a234e7e6f461591ae7ef1 on corentindrouet:add_multi_users into 0beb2d02c77dafccc0459dd02a38550144d025e2 on Nanocloud:master.
Coverage increased (+0.9%) to 70.666% when pulling 31e7b11533f4f2270a40eaf540fcc745fef3da38 on corentindrouet:add_multi_users into 721051b859026957afabb3194fce4eaef0dd9ddb on Nanocloud:master.
Refactor the connections between users and machines:
Little modification of plaza, and refactoring of fake plaza: