From ef2b2aea028c0720eec554160b75240a6db9c9b9 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Mon, 27 Dec 2010 18:24:51 +1300 Subject: [PATCH] Improve docs on DAVResource::NeedPrivilege() method. Signed-off-by: Andrew McMillan --- inc/DAVResource.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/inc/DAVResource.php b/inc/DAVResource.php index 8b0213b2..d76bec14 100644 --- a/inc/DAVResource.php +++ b/inc/DAVResource.php @@ -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 }