示例#1
0
 /**
  * Converts the v1 principal `principal/<username>` to the new v2
  * `principal/users/<username>` which is required for permission checks
  *
  * @inheritdoc
  */
 function getCurrentUserPrincipal()
 {
     $principalV1 = parent::getCurrentUserPrincipal();
     if (is_null($principalV1)) {
         return $principalV1;
     }
     return $this->convertPrincipal($principalV1, true);
 }
示例#2
0
 function propFind(PropFind $propFind, INode $node)
 {
     /* Overload current-user-principal */
     $propFind->handle('{DAV:}current-user-principal', function () {
         if ($url = parent::getCurrentUserPrincipal()) {
             return new Principal(Principal::HREF, $url . '/');
         } else {
             return new Principal(Principal::UNAUTHENTICATED);
         }
     });
     parent::propFind($propFind, $node);
 }