API CHANGE:

Add a new action to the sysadm/users class: "groupmod"
This action allows for modifying a given group on the system

REQUIRED: "name"="<name of group to modify>"
and any one of these options is also required:
"users":["array of users"] (will set the list of users for this group)
"add_users":["array of users"] (will add the listed users to the current users)
"remove_users":["array of users"] (will remove the listed users from the current users)

Example API Request (JSON)
{
"id":"sample",
"namespace":"sysadm",
"name":"users",
"args":{
  "action":"groupmod",
  "name":"operator",
  "users":["user1","user2"]
  }
}
This commit is contained in:
Ken Moore
2016-08-17 12:15:48 -04:00
parent 8700aab62a
commit 1fd947f5b4
2 changed files with 45 additions and 1 deletions

View File

@@ -962,6 +962,9 @@ RestOutputStruct::ExitCode WebSocket::EvaluateSysadmUserRequest(bool allaccess,
if(ok){ out->insert("result","success"); }
else{ out->insert("error","Could not delete group"); }
}else if(action=="groupmod" && allaccess){
ok = sysadm::UserManager::modifyGroup(out, in_args.toObject() );
}else if(action=="personacrypt_init"){
qDebug() << "got PC init request:" << in_args << allaccess << user;
bool go = true;