diff options
author | mistic100 <mistic@piwigo.org> | 2013-10-30 20:29:48 +0000 |
---|---|---|
committer | mistic100 <mistic@piwigo.org> | 2013-10-30 20:29:48 +0000 |
commit | 180e1a185c465511f1f848f82346afdf5fc31902 (patch) | |
tree | 60999222dad4358388ff78cf6705d0c76049a3a8 /ws.php | |
parent | c64eb85452aa7bb6d9c478db52aa59a81fa6752a (diff) |
feature 2976: add three methods for permissions management
git-svn-id: http://piwigo.org/svn/trunk@25245 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | ws.php | 52 |
1 files changed, 52 insertions, 0 deletions
@@ -882,6 +882,58 @@ function ws_addDefaultMethods( $arr ) null, array('admin_only'=>true, 'post_only'=>true) ); + + $service->addMethod( + 'pwg.permissions.getList', + 'ws_permissions_getList', + array( + 'cat_id' => array('flags'=>WS_PARAM_FORCE_ARRAY|WS_PARAM_OPTIONAL, + 'type'=>WS_TYPE_ID), + 'group_id' => array('flags'=>WS_PARAM_FORCE_ARRAY|WS_PARAM_OPTIONAL, + 'type'=>WS_TYPE_ID), + 'user_id' => array('flags'=>WS_PARAM_FORCE_ARRAY|WS_PARAM_OPTIONAL, + 'type'=>WS_TYPE_ID), + ), + '<b>Admin only.</b> Returns permissions: user ids and group ids having access to each album ; this list can be filterd with "cat_id". +<br>If "user_id" OR "group_id" is provided it returns a list of album ids the user or group has access to. +<br>Provide only on parameter!', + null, + array('admin_only'=>true) + ); + + $service->addMethod( + 'pwg.permissions.add', + 'ws_permissions_add', + array( + 'cat_id' => array('flags'=>WS_PARAM_FORCE_ARRAY, + 'type'=>WS_TYPE_ID), + 'group_id' => array('flags'=>WS_PARAM_FORCE_ARRAY|WS_PARAM_OPTIONAL, + 'type'=>WS_TYPE_ID), + 'user_id' => array('flags'=>WS_PARAM_FORCE_ARRAY|WS_PARAM_OPTIONAL, + 'type'=>WS_TYPE_ID), + 'recursive' => array('default'=>false, + 'type'=>WS_TYPE_BOOL), + ), + '<b>Admin only.</b> Adds permissions to an album.', + null, + array('admin_only'=>true) + ); + + $service->addMethod( + 'pwg.permissions.remove', + 'ws_permissions_remove', + array( + 'cat_id' => array('flags'=>WS_PARAM_FORCE_ARRAY, + 'type'=>WS_TYPE_ID), + 'group_id' => array('flags'=>WS_PARAM_FORCE_ARRAY|WS_PARAM_OPTIONAL, + 'type'=>WS_TYPE_ID), + 'user_id' => array('flags'=>WS_PARAM_FORCE_ARRAY|WS_PARAM_OPTIONAL, + 'type'=>WS_TYPE_ID), + ), + '<b>Admin & POST only.</b> Removes permissions from an album.', + null, + array('admin_only'=>true, 'post_only'=>true) + ); } ?>
\ No newline at end of file |