enhance phpdoc and add @access to specify which usergroup can use the ApiCommands; add --import-settings parameter to config-services.php CLI script to gain even more automatism when setting up

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2018-02-24 10:57:52 +01:00
parent 81d6a856d9
commit 9a61a56732
9 changed files with 217 additions and 62 deletions

View File

@@ -21,6 +21,8 @@ class FpmDaemons extends ApiCommand implements ResourceEntity
/**
* lists all fpm-daemon entries
*
* @access admin
* @throws Exception
* @return array count|list
*/
public function list()
@@ -72,6 +74,8 @@ class FpmDaemons extends ApiCommand implements ResourceEntity
*
* @param int $id fpm-daemon-id
*
* @access admin
* @throws Exception
* @return array
*/
public function get()
@@ -93,6 +97,13 @@ class FpmDaemons extends ApiCommand implements ResourceEntity
throw new Exception("Not allowed to execute given command.", 403);
}
/**
* create a new fpm-daemon entry
*
* @access admin
* @throws Exception
* @return array
*/
public function add()
{
if ($this->isAdmin() && $this->getUserDetail('change_serversettings') == 1) {
@@ -166,6 +177,15 @@ class FpmDaemons extends ApiCommand implements ResourceEntity
throw new Exception("Not allowed to execute given command.", 403);
}
/**
* update a fpm-daemon entry by given id
*
* @param int $id
*
* @access admin
* @throws Exception
* @return array
*/
public function update()
{
if ($this->isAdmin() && $this->getUserDetail('change_serversettings') == 1) {
@@ -251,6 +271,7 @@ class FpmDaemons extends ApiCommand implements ResourceEntity
*
* @param int $id fpm-daemon-id
*
* @access admin
* @throws Exception
* @return array
*/