mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-06-20 06:50:20 +00:00
Improve docs on DAVResource::NeedPrivilege() method.
Signed-off-by: Andrew McMillan <andrew@morphoss.com>
This commit is contained in:
parent
1e4c7e7a26
commit
ef2b2aea02
@ -656,15 +656,19 @@ EOQRY;
|
||||
|
||||
|
||||
/**
|
||||
* Check if we have the needed privilege or send an error response.
|
||||
* Check if we have the needed privilege or send an error response. If the user does not have the privileges then
|
||||
* the call will not return, and an XML error document will be output.
|
||||
*
|
||||
* @param string $privilege The name of the needed privilege.
|
||||
* @param boolean $any Whether we accept any of the privileges. The default is true, unless the requested privilege is 'all', when it is false.
|
||||
*/
|
||||
function NeedPrivilege( $privilege, $any = null ) {
|
||||
global $request;
|
||||
|
||||
// Do the test
|
||||
if ( $this->HavePrivilegeTo($privilege, $any) ) return;
|
||||
|
||||
// They failed, so output the error
|
||||
$request->NeedPrivilege( $privilege, $this->dav_name );
|
||||
exit(0); // Unecessary, but might clarify things
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user