Skip to content

Commit

Permalink
Fixed issue #23
Browse files Browse the repository at this point in the history
  • Loading branch information
disc5 committed Mar 15, 2016
1 parent e17296a commit 402f66d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@


/**
* Route: [GET] /v2/admin/permission/:permisionId
* Route: [GET] /v2/admin/permission/:permissionId
* [Admin required]
* Deletes the clients permission with selected permissionId
*
Expand All @@ -371,7 +371,7 @@
* 'id' <Number> - PermissionId of deleted database entry for this permission
* )
*/
$app->delete('/permission/:permisionId', Libs\RESTAuth::checkAccess(Libs\RESTAuth::ADMIN), function ($permissionId) use ($app) {
$app->delete('/permission/:permissionId', Libs\RESTAuth::checkAccess(Libs\RESTAuth::ADMIN), function ($permissionId) use ($app) {
// Delete permission via given permissionId
if (Database\RESTpermission::deleteByPrimary($permissionId) > 0)
$app->success(array( 'id' => intval($permissionId) ));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,30 @@ function gen_uuid() {
));
$ilDB->insert('ui_uihk_rest_perm', array(
'api_id' => array('integer', $id),
'pattern' => array('text', '/v2/admin/permission/:permisionId'),
'pattern' => array('text', '/v2/admin/permission/:permissionId'),
'verb' => array('text', 'DELETE')
));
$ilDB->insert('ui_uihk_rest_perm', array(
'api_id' => array('integer', $id),
'pattern' => array('text', '/v1/clients'),
'verb' => array('text', 'GET')
));
$ilDB->insert('ui_uihk_rest_perm', array(
'api_id' => array('integer', $id),
'pattern' => array('text', '/v1/clients/:id'),
'verb' => array('text', 'PUT')
));
$ilDB->insert('ui_uihk_rest_perm', array(
'api_id' => array('integer', $id),
'pattern' => array('text', '/v1/clients/'),
'verb' => array('text', 'POST')
));
$ilDB->insert('ui_uihk_rest_perm', array(
'api_id' => array('integer', $id),
'pattern' => array('text', '/v1/clients/:id'),
'verb' => array('text', 'DELETE')
));


global $ilLog;
$ilLog->write('Plugin REST -> DB-Update #6: Filled ui_uihk_rest_perm.');
Expand Down

0 comments on commit 402f66d

Please sign in to comment.