Logo Search packages:      
Sourcecode: davical version File versions  Download package

CalDAVRequest::AllowedTo ( activity )

Are we allowed to do the requested activity

+------------+------------------------------------------------------+ | METHOD | PRIVILEGES | +------------+------------------------------------------------------+ | MKCALENDAR | DAV:bind | | REPORT | DAV:read or CALDAV:read-free-busy (on all referenced | | | resources) | +------------+------------------------------------------------------+

Parameters:
string$activityThe activity we want to do.

Definition at line 592 of file CalDAVRequest.php.

                                  {
    if ( isset($this->permissions['all']) ) return true;
    switch( $activity ) {
      case "CALDAV:schedule-send-freebusy":
        return isset($this->permissions['read']) || isset($this->permissions['freebusy']);
        break;

      case "CALDAV:schedule-send-invite":
        return isset($this->permissions['read']) || isset($this->permissions['freebusy']);
        break;

      case "CALDAV:schedule-send-reply":
        return isset($this->permissions['read']) || isset($this->permissions['freebusy']);
        break;

      case 'freebusy':
        return isset($this->permissions['read']) || isset($this->permissions['freebusy']);
        break;

      case 'delete':
        return isset($this->permissions['write']) || isset($this->permissions['unbind']);
        break;

      case 'proppatch':
        return isset($this->permissions['write']) || isset($this->permissions['write-properties']);
        break;

      case 'modify':
        return isset($this->permissions['write']) || isset($this->permissions['write-content']);
        break;

      case 'create':
        return isset($this->permissions['write']) || isset($this->permissions['bind']);
        break;

      case 'mkcalendar':
      case 'mkcol':
        if ( !isset($this->permissions['write']) || !isset($this->permissions['bind']) ) return false;
        if ( $this->is_principal ) return false;
        if ( $this->path == '/' ) return false;
        break;

      case 'read':
      case 'lock':
      case 'unlock':
      default:
        return isset($this->permissions[$activity]);
        break;
    }

    return false;
  }

Generated by  Doxygen 1.6.0   Back to index