MXS-1354: Add creation of basic/admin users to maxctrl
The type of the created user can now be specified with the --type option. Expanded tests that cover the user creation. Also added a test case that checks that basic users are only allowed to read through the REST API.
This commit is contained in:
@ -35,11 +35,21 @@ exports.builder = function(yargs) {
|
||||
})
|
||||
}
|
||||
})
|
||||
.group(['type'], 'Enable account options:')
|
||||
.option('type', {
|
||||
describe: 'Type of user to create',
|
||||
type: 'string',
|
||||
default: 'basic',
|
||||
choices: ['admin', 'basic']
|
||||
})
|
||||
.command('account <name>', 'Activate a Linux user account for administrative use', {}, function(argv) {
|
||||
var req_body = {
|
||||
data: {
|
||||
id: argv.name,
|
||||
type: 'unix'
|
||||
type: 'unix',
|
||||
attributes: {
|
||||
'account': argv.type
|
||||
}
|
||||
}
|
||||
}
|
||||
maxctrl(argv, function(host) {
|
||||
|
Reference in New Issue
Block a user