/** * Get a list of permissions for browsing and utilizing the source. May be overridden to provide a custom * list of permissions. * @return array */ public function getPermissions() { $this->permissions = array('directory_chmod' => $this->xpdo->hasPermission('directory_chmod'), 'directory_create' => $this->xpdo->hasPermission('directory_create'), 'directory_list' => $this->xpdo->hasPermission('directory_list'), 'directory_remove' => $this->xpdo->hasPermission('directory_remove'), 'directory_update' => $this->xpdo->hasPermission('directory_update'), 'file_list' => $this->xpdo->hasPermission('file_list'), 'file_remove' => $this->xpdo->hasPermission('file_remove'), 'file_update' => $this->xpdo->hasPermission('file_update'), 'file_upload' => $this->xpdo->hasPermission('file_upload'), 'file_view' => $this->xpdo->hasPermission('file_view'), 'file_create' => $this->xpdo->hasPermission('file_create')); return $this->permissions; }
/** * Determines if the active user can post or not * * @param xPDO $modx A reference to the modX object * @return bool */ public static function canPostNew(xPDO &$modx) { if ($modx->discuss->user->isAdmin()) { return true; } return $modx->hasPermission('discuss.thread_create'); }