diff options
Diffstat (limited to 'lib/plugins/acl/remote.php')
-rw-r--r-- | lib/plugins/acl/remote.php | 53 |
1 files changed, 34 insertions, 19 deletions
diff --git a/lib/plugins/acl/remote.php b/lib/plugins/acl/remote.php index 27c5c162a..31a8cde53 100644 --- a/lib/plugins/acl/remote.php +++ b/lib/plugins/acl/remote.php @@ -1,16 +1,20 @@ <?php +use dokuwiki\Remote\AccessDeniedException; + /** * Class remote_plugin_acl */ -class remote_plugin_acl extends DokuWiki_Remote_Plugin { +class remote_plugin_acl extends DokuWiki_Remote_Plugin +{ /** * Returns details about the remote plugin methods * - * @return array Information about all provided methods. {@see RemoteAPI} + * @return array Information about all provided methods. {@see dokuwiki\Remote\RemoteAPI} */ - public function _getMethods() { + public function _getMethods() + { return array( 'listAcls' => array( 'args' => array(), @@ -34,16 +38,20 @@ class remote_plugin_acl extends DokuWiki_Remote_Plugin { /** * List all ACL config entries * - * @throws RemoteAccessDeniedException + * @throws AccessDeniedException * @return dictionary {Scope: ACL}, where ACL = dictionnary {user/group: permissions_int} */ - public function listAcls(){ - if(!auth_isadmin()) { - throw new RemoteAccessDeniedException('You are not allowed to access ACLs, superuser permission is required', 114); + public function listAcls() + { + if (!auth_isadmin()) { + throw new AccessDeniedException( + 'You are not allowed to access ACLs, superuser permission is required', + 114 + ); } /** @var admin_plugin_acl $apa */ $apa = plugin_load('admin', 'acl'); - $apa->_init_acl_config(); + $apa->initAclConfig(); return $apa->acl; } @@ -53,17 +61,21 @@ class remote_plugin_acl extends DokuWiki_Remote_Plugin { * @param string $scope * @param string $user * @param int $level see also inc/auth.php - * @throws RemoteAccessDeniedException + * @throws AccessDeniedException * @return bool */ - public function addAcl($scope, $user, $level){ - if(!auth_isadmin()) { - throw new RemoteAccessDeniedException('You are not allowed to access ACLs, superuser permission is required', 114); + public function addAcl($scope, $user, $level) + { + if (!auth_isadmin()) { + throw new AccessDeniedException( + 'You are not allowed to access ACLs, superuser permission is required', + 114 + ); } /** @var admin_plugin_acl $apa */ $apa = plugin_load('admin', 'acl'); - return $apa->_acl_add($scope, $user, $level); + return $apa->addACL($scope, $user, $level); } /** @@ -71,17 +83,20 @@ class remote_plugin_acl extends DokuWiki_Remote_Plugin { * * @param string $scope * @param string $user - * @throws RemoteAccessDeniedException + * @throws AccessDeniedException * @return bool */ - public function delAcl($scope, $user){ - if(!auth_isadmin()) { - throw new RemoteAccessDeniedException('You are not allowed to access ACLs, superuser permission is required', 114); + public function delAcl($scope, $user) + { + if (!auth_isadmin()) { + throw new AccessDeniedException( + 'You are not allowed to access ACLs, superuser permission is required', + 114 + ); } /** @var admin_plugin_acl $apa */ $apa = plugin_load('admin', 'acl'); - return $apa->_acl_del($scope, $user); + return $apa->deleteACL($scope, $user); } } - |