Add NeedPrivilege() method to DAVResource and simplify request method.

This commit is contained in:
Andrew McMillan committed 2009-12-26 11:19:21 +13:00
1 parent e0e5887762
commit ebbec96269
3 files changed
+25 -6

No files matched your search

+15
View File
@@ -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
*/