MXS-2574: Prevent alterations to current user
Due to the fact that the alteration is emulated by deletion and creation of the user in question, the current user cannot be altered.
This commit is contained in:
parent
9d06ff8402
commit
7117ab4719
@ -141,6 +141,10 @@ exports.builder = function(yargs) {
|
||||
}, function(argv) {
|
||||
maxctrl(argv, function(host) {
|
||||
|
||||
if (argv.u == argv.name) {
|
||||
return error('Cannot alter current user')
|
||||
}
|
||||
|
||||
var user = {
|
||||
'data': {
|
||||
'id': argv.name,
|
||||
|
@ -108,6 +108,11 @@ describe("Alter Commands", function() {
|
||||
.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() {
|
||||
return verifyCommand('create user testuser test', 'users/inet/testuser')
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user