user: remove make local feature

we discussed a bit on what this does and it's confusing as it stands:

* Use case of this is lost in the realms of time
* Possible guess by is that it was to move users of different Cloudron to a central cloudron
* Currently, the design is a bit flawed because the make user local button doesn’t pin the user. The state is lost in next synchronization.
* Maybe, one should use export/import user for this use case
* Let’s disable this button for now, feature is not complete.
This commit is contained in:
Girish Ramakrishnan
2024-01-13 11:00:43 +01:00
parent 33a97d0e50
commit 2ca94f3159
15 changed files with 132 additions and 198 deletions

View File

@@ -211,39 +211,6 @@ describe('Users API', function () {
});
});
describe('make local', function () {
let userId;
before(async function () {
const response = await superagent.post(`${serverUrl}/api/v1/users`)
.query({ access_token: owner.token })
.send({ username: 'ldapuser', email: 'ldapuser@example.com' });
expect(response.statusCode).to.equal(201);
userId = response.body.id;
});
it('cannot make a local user local', async function () {
const response = await superagent.post(`${serverUrl}/api/v1/users/${userId}/make_local`)
.query({ access_token: owner.token })
.send({})
.ok(() => true);
expect(response.statusCode).to.equal(409);
});
it('succeeds', async function () {
await users.update({ id: userId }, { source: 'ldap' }, {});
const response = await superagent.post(`${serverUrl}/api/v1/users/${userId}/make_local`)
.query({ access_token: owner.token })
.send({});
expect(response.statusCode).to.equal(204);
});
});
describe('admin status', function () {
it('set second user as admin succeeds', async function () {
const response = await superagent.post(`${serverUrl}/api/v1/users/${user.id}`)