mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-11-29 08:56:03 +00:00
Add NeedPrivilege() method to DAVResource and simplify request method.
This commit is contained in:
1 parent
e0e5887762
commit
ebbec96269
3 files changed
+25
-6
No files matched your search
@@ -509,6 +509,21 @@ EOQRY;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if we have the needed privilege or send an error response.
|
||||
*
|
||||
* @param string $privilege The name of the needed privilege.
|
||||
*/
|
||||
function NeedPrivilege( $privilege ) {
|
||||
global $request;
|
||||
|
||||
if ( $this->HavePrivilegeTo($privilege) ) return;
|
||||
|
||||
$request->NeedPrivilege( $privilege, $this->dav_name );
|
||||
exit(0); // Unecessary, but might clarify things
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the array of privilege names converted into XMLElements
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user