Add user management scope

This splits the user and groups API into those who have just 'read' access
and those who have 'manage' access.
This commit is contained in:
Girish Ramakrishnan
2018-06-25 15:54:24 -07:00
parent 7ab5d5e50d
commit f932f8b3d3
7 changed files with 31 additions and 24 deletions

View File

@@ -338,7 +338,7 @@ describe('Users API', function () {
});
});
it('list groupIds when listing users', function (done) {
it('does not list groupIds when listing users', function (done) {
superagent.get(SERVER_URL + '/api/v1/users')
.query({ access_token: token })
.end(function (error, res) {
@@ -347,7 +347,7 @@ describe('Users API', function () {
expect(res.body.users).to.be.an('array');
res.body.users.forEach(function (user) {
expect(user.groupIds).to.eql([ constants.ADMIN_GROUP_ID ]);
expect('groupIds' in user).to.be(false);
});
done();
});
@@ -502,7 +502,7 @@ describe('Users API', function () {
expect(user.email).to.be.ok();
expect(user.password).to.not.be.ok();
expect(user.salt).to.not.be.ok();
expect(user.groupIds).to.be.an(Array);
expect(user.groupIds).to.not.be.ok();
});
done();