ez components / documentation / api reference / trunk / webdav

eZ Components trunk

Webdav: ezcWebdavAuthorizer

[ Tutorial ] [ Clients ] [ Plugin architecture ] [ Class tree ] [ Element index ] [ ChangeLog ] [ Credits ]

Interface: ezcWebdavAuthorizer

Interface for classes providing authorization. [source]
This interface must be implemented by classes the provide authorization to an ezcWebdavBackend. A back end will call the authorize() method for each path that is affected by request.


Child Class Description
ezcWebdavLockAuthorizer Interface to be implemented by authorization classes for the lock plugin.


ACCESS_READ = 1 User desires read access.
ACCESS_WRITE = 2 User desires write access.

Method Summary

public bool authorize( $user, $path, [$access = self::ACCESS_READ] )
Checks authorization of the given $user to a given $path.



bool authorize( string $user, string $path, [int $access = self::ACCESS_READ] )
Checks authorization of the given $user to a given $path.
This method checks if the given $user has the permission $access to the resource identified by $path. The $path is the result of a translation by the servers ezcWebdavPathFactory from the request URI.
The implementation of this method must only check the given $path, but MUST not check descendant paths, since the back end will issue dedicated calls for such paths. In contrast, the algoritm MUST ensure, that parent permission constraints of the given $paths are met.
Examples: Permission is rejected for the paths "/a", "/b/beamme" and "/c/connect":
 1.  <?php
 2.  var_dump$auth->authorize'johndoe''/a' ) )// false
 3.  var_dump$auth->authorize'johndoe''/b' ) )// true
 4.  var_dump$auth->authorize'johndoe''/b/beamme' ) )// false
 5.  var_dump$auth->authorize'johndoe''/c/connect/some/deeper/path' ) )// false
 6.  ?>


Name Type Description
$user string  
$path string  
$access int  

Last updated: Mon, 21 Dec 2009