aboutsummaryrefslogtreecommitdiffstats
path: root/ws.php
diff options
context:
space:
mode:
Diffstat (limited to 'ws.php')
-rw-r--r--ws.php52
1 files changed, 52 insertions, 0 deletions
diff --git a/ws.php b/ws.php
index d55f9d900..c92523b5a 100644
--- a/ws.php
+++ b/ws.php
@@ -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