Merge branch '2.3' into 2.4

This commit is contained in:
Markus Mäkelä
2019-06-24 13:10:20 +03:00
2 changed files with 9 additions and 0 deletions

View File

@ -192,6 +192,10 @@ exports.builder = function(yargs) {
}, function(argv) { }, function(argv) {
maxctrl(argv, function(host) { maxctrl(argv, function(host) {
if (argv.u == argv.name) {
return error('Cannot alter current user')
}
var user = { var user = {
'data': { 'data': {
'id': argv.name, 'id': argv.name,

View File

@ -195,6 +195,11 @@ describe("Alter Commands", function() {
.should.be.rejected .should.be.rejected
}) })
it('rejects alteration to current user', function() {
return doCommand('-u bob -p bob alter user bob bob2')
.should.be.rejected
})
it('creates user', function() { it('creates user', function() {
return verifyCommand('create user testuser test', 'users/inet/testuser') return verifyCommand('create user testuser test', 'users/inet/testuser')
}) })