Remove user.admin property
The UI will now base itself entirely off the scopes of the token
This commit is contained in:
@@ -102,11 +102,10 @@ describe('Profile API', function () {
|
||||
expect(result.body.username).to.equal(USERNAME_0.toLowerCase());
|
||||
expect(result.body.email).to.equal(EMAIL_0.toLowerCase());
|
||||
expect(result.body.fallbackEmail).to.equal(EMAIL_0.toLowerCase());
|
||||
expect(result.body.admin).to.be.ok();
|
||||
expect(result.body.displayName).to.be.a('string');
|
||||
expect(result.body.password).to.not.be.ok();
|
||||
expect(result.body.salt).to.not.be.ok();
|
||||
expect(result.body.tokenScope).to.be('apps,clients,cloudron,domains,mail,profile,settings,users');
|
||||
expect(result.body.tokenScope).to.be(accesscontrol.VALID_SCOPES.join(','));
|
||||
|
||||
user_0 = result.body;
|
||||
|
||||
@@ -141,11 +140,10 @@ describe('Profile API', function () {
|
||||
expect(result.statusCode).to.equal(200);
|
||||
expect(result.body.username).to.equal(USERNAME_0.toLowerCase());
|
||||
expect(result.body.email).to.equal(EMAIL_0.toLowerCase());
|
||||
expect(result.body.admin).to.be.ok();
|
||||
expect(result.body.displayName).to.be.a('string');
|
||||
expect(result.body.password).to.not.be.ok();
|
||||
expect(result.body.salt).to.not.be.ok();
|
||||
expect(result.body.tokenScope).to.be('apps,clients,cloudron,domains,mail,profile,settings,users');
|
||||
expect(result.body.tokenScope).to.be(accesscontrol.VALID_SCOPES.join(','));
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -198,7 +196,7 @@ describe('Profile API', function () {
|
||||
expect(res.body.username).to.equal(USERNAME_0.toLowerCase());
|
||||
expect(res.body.email).to.equal(EMAIL_0_NEW.toLowerCase());
|
||||
expect(res.body.fallbackEmail).to.equal(EMAIL_0_NEW_FALLBACK.toLowerCase());
|
||||
expect(res.body.admin).to.equal(true);
|
||||
expect(res.body.tokenScope).to.be(accesscontrol.VALID_SCOPES.join(','));
|
||||
expect(res.body.displayName).to.equal('');
|
||||
|
||||
done();
|
||||
@@ -219,7 +217,7 @@ describe('Profile API', function () {
|
||||
expect(res.statusCode).to.equal(200);
|
||||
expect(res.body.username).to.equal(USERNAME_0.toLowerCase());
|
||||
expect(res.body.email).to.equal(EMAIL_0_NEW.toLowerCase());
|
||||
expect(res.body.admin).to.be.ok();
|
||||
expect(res.body.tokenScope).to.be(accesscontrol.VALID_SCOPES.join(','));
|
||||
expect(res.body.displayName).to.equal(DISPLAY_NAME_0_NEW);
|
||||
|
||||
done();
|
||||
|
||||
Reference in New Issue
Block a user