ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
Public Member Functions | |
getFeatures () | |
Returns a list of features added by this plugin. More... | |
getMethods ($uri) | |
Returns a list of available methods for a given url. More... | |
getPluginName () | |
Returns a plugin name. More... | |
getSupportedReportSet ($uri) | |
Returns a list of reports this plugin supports. More... | |
checkPrivileges ($uri, $privileges, $recursion=self::R_PARENT, $throwExceptions=true) | |
Checks if the current user has the specified privilege(s). More... | |
getCurrentUserPrincipals () | |
Returns a list of principals that's associated to the current user, either directly or through group membership. More... | |
setDefaultAcl (array $acl) | |
Sets the default ACL rules. More... | |
getDefaultAcl () | |
Returns the default ACL rules. More... | |
getPrincipalMembership ($mainPrincipal) | |
Returns all the principal groups the specified principal is a member of. More... | |
principalMatchesPrincipal ($checkPrincipal, $currentPrincipal=null) | |
Find out of a principal equals another principal. More... | |
getSupportedPrivilegeSet ($node) | |
Returns a tree of supported privileges for a resource. More... | |
getFlatPrivilegeSet ($node) | |
Returns the supported privilege set as a flat list. More... | |
getAcl ($node) | |
Returns the full ACL list. More... | |
getCurrentUserPrivilegeSet ($node) | |
Returns a list of privileges the current user has on a particular node. More... | |
getPrincipalByUri ($uri) | |
Returns a principal based on its uri. More... | |
principalSearch (array $searchProperties, array $requestedProperties, $collectionUri=null, $test='allof') | |
Principal property search. More... | |
initialize (DAV\Server $server) | |
Sets up the plugin. More... | |
beforeMethod (RequestInterface $request, ResponseInterface $response) | |
Triggered before any method is handled. More... | |
beforeBind ($uri) | |
Triggered before a new node is created. More... | |
beforeUnbind ($uri) | |
Triggered before a node is deleted. More... | |
beforeUnlock ($uri, DAV\Locks\LockInfo $lock) | |
Triggered before a node is unlocked. More... | |
propFind (DAV\PropFind $propFind, DAV\INode $node) | |
Triggered before properties are looked up in specific nodes. More... | |
propPatch ($path, DAV\PropPatch $propPatch) | |
This method intercepts PROPPATCH methods and make sure the group-member-set is updated correctly. More... | |
report ($reportName, $report, $path) | |
This method handles HTTP REPORT requests. More... | |
httpAcl (RequestInterface $request, ResponseInterface $response) | |
This method is responsible for handling the 'ACL' event. More... | |
htmlActionsPanel (DAV\INode $node, &$output) | |
This method is used to generate HTML output for the DAV. More... | |
getPluginInfo () | |
Returns a bunch of meta-data about the plugin. More... | |
Public Member Functions inherited from Sabre\DAV\ServerPlugin | |
initialize (Server $server) | |
This initializes the plugin. More... | |
getFeatures () | |
This method should return a list of server-features. More... | |
getHTTPMethods ($path) | |
Use this method to tell the server this plugin defines additional HTTP methods. More... | |
getPluginName () | |
Returns a plugin name. More... | |
getSupportedReportSet ($uri) | |
Returns a list of reports this plugin supports. More... | |
getPluginInfo () | |
Returns a bunch of meta-data about the plugin. More... | |
Data Fields | |
const | R_PARENT = 1 |
Recursion constants. More... | |
const | R_RECURSIVE = 2 |
Recursion constants. More... | |
const | R_RECURSIVEPARENTS = 3 |
Recursion constants. More... | |
$principalCollectionSet | |
$hideNodesFromListings = false | |
$principalSearchPropertySet | |
$adminPrincipals = [] | |
$allowUnauthenticatedAccess = true | |
Protected Member Functions | |
principalMatchReport ($path, Xml\Request\PrincipalMatchReport $report) | |
The principal-match report is defined in RFC3744, section 9.3. More... | |
expandPropertyReport ($path, $report) | |
The expand-property report is defined in RFC3253 section 3.8. More... | |
expandProperties ($path, array $requestedProperties, $depth) | |
This method expands all the properties and returns a list with property values. More... | |
principalSearchPropertySetReport ($path, $report) | |
principalSearchPropertySetReport More... | |
principalPropertySearchReport ($path, Xml\Request\PrincipalPropertySearchReport $report) | |
principalPropertySearchReport More... | |
aclPrincipalPropSetReport ($path, Xml\Request\AclPrincipalPropSetReport $report) | |
aclPrincipalPropSet REPORT More... | |
Protected Attributes | |
$server | |
$defaultAcl | |
$principalMembershipCache = [] | |
SabreDAV ACL Plugin.
This plugin provides functionality to enforce ACL permissions. ACL is defined in RFC3744.
In addition it also provides support for the {DAV:}current-user-principal property, defined in RFC5397 and the {DAV:}expand-property report, as defined in RFC3253.
Definition at line 31 of file Plugin.php.
|
protected |
aclPrincipalPropSet REPORT
This method is responsible for handling the {DAV:}acl-principal-prop-set REPORT, as defined in:
https://tools.ietf.org/html/rfc3744#section-9.2
This REPORT allows a user to quickly fetch information about all principals specified in the access control list. Most commonly this is used to for example generate a UI with ACL rules, allowing you to show names for principals for every entry.
string | $path | |
Xml\Request\AclPrincipalPropSetReport | $report |
Definition at line 1544 of file Plugin.php.
References $path.
Referenced by Sabre\DAVACL\Plugin\report().
Sabre\DAVACL\Plugin::beforeBind | ( | $uri | ) |
Triggered before a new node is created.
This allows us to check permissions for any operation that creates a new node, such as PUT, MKCOL, MKCALENDAR, LOCK, COPY and MOVE.
string | $uri |
Definition at line 942 of file Plugin.php.
References Sabre\DAVACL\Plugin\checkPrivileges(), and Sabre\Uri\split().
Sabre\DAVACL\Plugin::beforeMethod | ( | RequestInterface | $request, |
ResponseInterface | $response | ||
) |
Triggered before any method is handled.
RequestInterface | $request | |
ResponseInterface | $response |
Definition at line 873 of file Plugin.php.
References $path, Sabre\DAVACL\Plugin\checkPrivileges(), Sabre\HTTP\RequestInterface\getMethod(), and Sabre\HTTP\RequestInterface\getPath().
Sabre\DAVACL\Plugin::beforeUnbind | ( | $uri | ) |
Triggered before a node is deleted.
This allows us to check permissions for any operation that will delete an existing node.
string | $uri |
Definition at line 958 of file Plugin.php.
References Sabre\DAVACL\Plugin\checkPrivileges(), and Sabre\Uri\split().
Sabre\DAVACL\Plugin::beforeUnlock | ( | $uri, | |
DAV\Locks\LockInfo | $lock | ||
) |
Triggered before a node is unlocked.
string | $uri | |
DAV\Locks\LockInfo | $lock | : not yet implemented |
Definition at line 973 of file Plugin.php.
Sabre\DAVACL\Plugin::checkPrivileges | ( | $uri, | |
$privileges, | |||
$recursion = self::R_PARENT , |
|||
$throwExceptions = true |
|||
) |
Checks if the current user has the specified privilege(s).
You can specify a single privilege, or a list of privileges. This method will throw an exception if the privilege is not available and return true otherwise.
string | $uri | |
array | string | $privileges | |
int | $recursion | |
bool | $throwExceptions | if set to false, this method won't throw exceptions. |
NeedPrivileges | |
NotAuthenticated |
Definition at line 192 of file Plugin.php.
References $authPlugin, $failed, and Sabre\DAVACL\Plugin\getCurrentUserPrivilegeSet().
Referenced by Sabre\DAVACL\Plugin\beforeBind(), Sabre\DAVACL\Plugin\beforeMethod(), Sabre\DAVACL\Plugin\beforeUnbind(), and Sabre\DAVACL\Plugin\propFind().
|
protected |
This method expands all the properties and returns a list with property values.
array | $path | |
array | $requestedProperties | the list of required properties |
int | $depth |
Definition at line 1392 of file Plugin.php.
References $path, and $result.
Referenced by Sabre\DAVACL\Plugin\expandPropertyReport().
|
protected |
The expand-property report is defined in RFC3253 section 3.8.
This report is very similar to a standard PROPFIND. The difference is that it has the additional ability to look at properties containing a {DAV:}href element, follow that property and grab additional elements there.
Other rfc's, such as ACL rely on this report, so it made sense to put it in this plugin.
string | $path | |
Xml\Request\ExpandPropertyReport | $report |
Definition at line 1366 of file Plugin.php.
References $path, $result, $xml, and Sabre\DAVACL\Plugin\expandProperties().
Referenced by Sabre\DAVACL\Plugin\report().
Sabre\DAVACL\Plugin::getAcl | ( | $node | ) |
Returns the full ACL list.
Either a uri or a INode may be passed.
null will be returned if the node doesn't support ACLs.
string | DAV\INode | $node |
Definition at line 587 of file Plugin.php.
References Sabre\DAVACL\Plugin\getDefaultAcl().
Sabre\DAVACL\Plugin::getCurrentUserPrincipals | ( | ) |
Returns a list of principals that's associated to the current user, either directly or through group membership.
Definition at line 255 of file Plugin.php.
References Sabre\DAVACL\Plugin\getPrincipalMembership().
Referenced by Sabre\DAVACL\Plugin\principalMatchReport().
Sabre\DAVACL\Plugin::getCurrentUserPrivilegeSet | ( | $node | ) |
Returns a list of privileges the current user has on a particular node.
Either a uri or a DAV may be passed.
null will be returned if the node doesn't support ACLs.
string | DAV\INode | $node |
Definition at line 618 of file Plugin.php.
References $current, Sabre\DAVACL\Plugin\getFlatPrivilegeSet(), and Sabre\DAVACL\Plugin\principalMatchesPrincipal().
Referenced by Sabre\DAVACL\Plugin\checkPrivileges(), and Sabre\DAVACL\Plugin\propFind().
Sabre\DAVACL\Plugin::getDefaultAcl | ( | ) |
Returns the default ACL rules.
These rules are used for all nodes that don't implement the IACL interface.
Definition at line 289 of file Plugin.php.
References Sabre\DAVACL\Plugin\$defaultAcl.
Referenced by Sabre\DAVACL\Plugin\getAcl().
Sabre\DAVACL\Plugin::getFeatures | ( | ) |
Returns a list of features added by this plugin.
This list is used in the response of a HTTP OPTIONS request.
Definition at line 123 of file Plugin.php.
|
final |
Returns the supported privilege set as a flat list.
This is much easier to parse.
The returned list will be index by privilege name. The value is a struct containing the following properties:
string | INode | $node |
Definition at line 529 of file Plugin.php.
References Sabre\DAVACL\Plugin\getSupportedPrivilegeSet().
Referenced by Sabre\DAVACL\Plugin\getCurrentUserPrivilegeSet(), and Sabre\DAVACL\Plugin\httpAcl().
Sabre\DAVACL\Plugin::getMethods | ( | $uri | ) |
Returns a list of available methods for a given url.
string | $uri |
Definition at line 135 of file Plugin.php.
Sabre\DAVACL\Plugin::getPluginInfo | ( | ) |
Returns a bunch of meta-data about the plugin.
Providing this information is optional, and is mainly displayed by the Browser plugin.
The description key in the returned array may contain html and will not be sanitized.
Definition at line 1627 of file Plugin.php.
References Sabre\DAVACL\Plugin\getPluginName().
Sabre\DAVACL\Plugin::getPluginName | ( | ) |
Returns a plugin name.
Using this name other plugins will be able to access other plugins using Sabre::getPlugin
Definition at line 149 of file Plugin.php.
Referenced by Sabre\DAVACL\Plugin\getPluginInfo().
Sabre\DAVACL\Plugin::getPrincipalByUri | ( | $uri | ) |
Returns a principal based on its uri.
Returns null if the principal could not be found.
string | $uri |
Definition at line 708 of file Plugin.php.
References Sabre\DAVACL\Plugin\$principalCollectionSet, and $result.
Referenced by Sabre\DAVACL\Plugin\initialize().
Sabre\DAVACL\Plugin::getPrincipalMembership | ( | $mainPrincipal | ) |
Returns all the principal groups the specified principal is a member of.
string | $mainPrincipal |
Definition at line 327 of file Plugin.php.
Referenced by Sabre\DAVACL\Plugin\getCurrentUserPrincipals(), and Sabre\DAVACL\Plugin\principalMatchesPrincipal().
Sabre\DAVACL\Plugin::getSupportedPrivilegeSet | ( | $node | ) |
Returns a tree of supported privileges for a resource.
The returned array structure should be in this form:
[ [ 'privilege' => '{DAV:}read', 'abstract' => false, 'aggregates' => [] ] ]
Privileges can be nested using "aggregates". Doing so means that if you assign someone the aggregating privilege, all the sub-privileges will automatically be granted.
Marking a privilege as abstract means that the privilege cannot be directly assigned, but must be assigned via the parent privilege.
So a more complex version might look like this:
[ [ 'privilege' => '{DAV:}read', 'abstract' => false, 'aggregates' => [ [ 'privilege' => '{DAV:}read-acl', 'abstract' => false, 'aggregates' => [], ] ] ] ]
string | INode | $node |
Definition at line 441 of file Plugin.php.
Referenced by Sabre\DAVACL\Plugin\getFlatPrivilegeSet(), and Sabre\DAVACL\Plugin\propFind().
Sabre\DAVACL\Plugin::getSupportedReportSet | ( | $uri | ) |
Returns a list of reports this plugin supports.
This will be used in the {DAV:}supported-report-set property. Note that you still need to subscribe to the 'report' event to actually implement them
string | $uri |
Definition at line 165 of file Plugin.php.
Sabre\DAVACL\Plugin::htmlActionsPanel | ( | DAV\INode | $node, |
& | $output | ||
) |
This method is used to generate HTML output for the DAV.
This allows us to generate an interface users can use to create new calendars.
DAV\INode | $node | |
string | $output |
Definition at line 1596 of file Plugin.php.
References Sabre\VObject\$output.
Sabre\DAVACL\Plugin::httpAcl | ( | RequestInterface | $request, |
ResponseInterface | $response | ||
) |
This method is responsible for handling the 'ACL' event.
RequestInterface | $request | |
ResponseInterface | $response |
Definition at line 1166 of file Plugin.php.
References $path, Sabre\HTTP\MessageInterface\getBodyAsString(), Sabre\DAVACL\Plugin\getFlatPrivilegeSet(), Sabre\HTTP\RequestInterface\getPath(), and Sabre\HTTP\ResponseInterface\setStatus().
Sabre\DAVACL\Plugin::initialize | ( | DAV\Server | $server | ) |
Sets up the plugin.
This method is automatically called by the server class.
DAV\Server | $server |
Definition at line 804 of file Plugin.php.
References $authPlugin, Sabre\DAVACL\Plugin\$server, and Sabre\DAVACL\Plugin\getPrincipalByUri().
Sabre\DAVACL\Plugin::principalMatchesPrincipal | ( | $checkPrincipal, | |
$currentPrincipal = null |
|||
) |
Find out of a principal equals another principal.
This is a quick way to find out whether a principal URI is part of a group, or any subgroups.
The first argument is the principal URI you want to check against. For example the principal group, and the second argument is the principal of which you want to find out of it is the same as the first principal, or in a member of the first principal's group or subgroups.
So the arguments are not interchangeable. If principal A is in group B, passing 'B', 'A' will yield true, but 'A', 'B' is false.
If the second argument is not passed, we will use the current user principal.
string | $checkPrincipal | |
string | $currentPrincipal |
Definition at line 386 of file Plugin.php.
References Sabre\DAVACL\Plugin\getPrincipalMembership().
Referenced by Sabre\DAVACL\Plugin\getCurrentUserPrivilegeSet().
|
protected |
The principal-match report is defined in RFC3744, section 9.3.
This report allows a client to figure out based on the current user, or a principal URL, the principal URL and principal URLs of groups that principal belongs to.
string | $path | |
Xml\Request\PrincipalMatchReport | $report |
Definition at line 1259 of file Plugin.php.
References $path, $result, and Sabre\DAVACL\Plugin\getCurrentUserPrincipals().
Referenced by Sabre\DAVACL\Plugin\report().
|
protected |
principalPropertySearchReport
This method is responsible for handing the {DAV:}principal-property-search report. This report can be used for clients to search for groups of principals, based on the value of one or more properties.
string | $path | |
Xml\Request\PrincipalPropertySearchReport | $report |
Definition at line 1503 of file Plugin.php.
References $path, $result, and Sabre\DAVACL\Plugin\principalSearch().
Referenced by Sabre\DAVACL\Plugin\report().
Sabre\DAVACL\Plugin::principalSearch | ( | array | $searchProperties, |
array | $requestedProperties, | ||
$collectionUri = null , |
|||
$test = 'allof' |
|||
) |
Principal property search.
This method can search for principals matching certain values in properties.
This method will return a list of properties for the matched properties.
array | $searchProperties | The properties to search on. This is a key-value list. The keys are property names, and the values the strings to match them on. |
array | $requestedProperties | This is the list of properties to return for every match. |
string | $collectionUri | The principal collection to search on. If this is ommitted, the standard principal collection-set will be used. |
string | $test | "allof" to use AND to search the properties. 'anyof' for OR. |
Definition at line 759 of file Plugin.php.
References Sabre\DAVACL\Plugin\$principalCollectionSet, $result, $results, and $test.
Referenced by Sabre\DAVACL\Plugin\principalPropertySearchReport().
|
protected |
principalSearchPropertySetReport
This method responsible for handing the {DAV:}principal-search-property-set report. This report returns a list of properties the client may search on, using the {DAV:}principal-property-search report.
string | $path | |
Xml\Request\PrincipalSearchPropertySetReport | $report |
Definition at line 1448 of file Plugin.php.
References $description.
Referenced by Sabre\DAVACL\Plugin\report().
Sabre\DAVACL\Plugin::propFind | ( | DAV\PropFind | $propFind, |
DAV\INode | $node | ||
) |
Triggered before properties are looked up in specific nodes.
DAV\PropFind | $propFind | |
DAV\INode | $node | really should be broken into multiple methods, or even a class. |
Definition at line 986 of file Plugin.php.
References $path, Sabre\DAVACL\Plugin\$principalCollectionSet, $url, Sabre\DAVACL\Plugin\checkPrivileges(), Sabre\DAVACL\Plugin\getCurrentUserPrivilegeSet(), and Sabre\DAVACL\Plugin\getSupportedPrivilegeSet().
Sabre\DAVACL\Plugin::propPatch | ( | $path, | |
DAV\PropPatch | $propPatch | ||
) |
This method intercepts PROPPATCH methods and make sure the group-member-set is updated correctly.
string | $path | |
DAV\PropPatch | $propPatch |
Definition at line 1093 of file Plugin.php.
References $path.
Sabre\DAVACL\Plugin::report | ( | $reportName, | |
$report, | |||
$path | |||
) |
This method handles HTTP REPORT requests.
string | $reportName | |
mixed | $report | |
mixed | $path |
Definition at line 1130 of file Plugin.php.
References $path, Sabre\DAVACL\Plugin\aclPrincipalPropSetReport(), Sabre\DAVACL\Plugin\expandPropertyReport(), Sabre\DAVACL\Plugin\principalMatchReport(), Sabre\DAVACL\Plugin\principalPropertySearchReport(), and Sabre\DAVACL\Plugin\principalSearchPropertySetReport().
Sabre\DAVACL\Plugin::setDefaultAcl | ( | array | $acl | ) |
Sets the default ACL rules.
These rules are used for all nodes that don't implement the IACL interface.
array | $acl |
Definition at line 276 of file Plugin.php.
Sabre\DAVACL\Plugin::$adminPrincipals = [] |
Definition at line 102 of file Plugin.php.
Sabre\DAVACL\Plugin::$allowUnauthenticatedAccess = true |
Definition at line 114 of file Plugin.php.
|
protected |
Definition at line 304 of file Plugin.php.
Referenced by Sabre\DAVACL\Plugin\getDefaultAcl().
Sabre\DAVACL\Plugin::$hideNodesFromListings = false |
Definition at line 80 of file Plugin.php.
Sabre\DAVACL\Plugin::$principalCollectionSet |
Definition at line 67 of file Plugin.php.
Referenced by Sabre\DAVACL\Plugin\getPrincipalByUri(), Sabre\DAVACL\Plugin\principalSearch(), and Sabre\DAVACL\Plugin\propFind().
|
protected |
Definition at line 318 of file Plugin.php.
Sabre\DAVACL\Plugin::$principalSearchPropertySet |
Definition at line 90 of file Plugin.php.
|
protected |
Definition at line 59 of file Plugin.php.
Referenced by Sabre\DAVACL\Plugin\initialize().
const Sabre\DAVACL\Plugin::R_PARENT = 1 |
Recursion constants.
This only checks the base node
Definition at line 38 of file Plugin.php.
Referenced by Sabre\DAVACL\SimplePluginTest\testCheckPrivileges().
const Sabre\DAVACL\Plugin::R_RECURSIVE = 2 |
const Sabre\DAVACL\Plugin::R_RECURSIVEPARENTS = 3 |
Recursion constants.
This checks every parentnode in the tree, but not leaf-nodes.
Definition at line 52 of file Plugin.php.