File modules/cms/action/TaglistAction.class.php

Last commit: Thu Feb 16 22:57:35 2023 +0100	Jan Dankert	New: More functions (adding, deleting) for tags.
1 <?php 2 3 namespace cms\action; 4 5 use cms\model\Permission; 6 use cms\model\Folder; 7 use cms\model\Project; 8 use util\exception\SecurityException; 9 10 // OpenRat Content Management System 11 // Copyright (C) 2002-2012 Jan Dankert, cms@jandankert.de 12 // 13 // This program is free software; you can redistribute it and/or 14 // modify it under the terms of the GNU General Public License 15 // as published by the Free Software Foundation; either version 2 16 // of the License, or (at your option) any later version. 17 // 18 // This program is distributed in the hope that it will be useful, 19 // but WITHOUT ANY WARRANTY; without even the implied warranty of 20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 // GNU General Public License for more details. 22 // 23 // You should have received a copy of the GNU General Public License 24 // along with this program; if not, write to the Free Software 25 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 26 27 28 /** 29 * Action-Klasse zum Bearbeiten eines Projektes 30 * @author $Author$ 31 * @version $Revision$ 32 * @package openrat.actions 33 */ 34 class TaglistAction extends BaseAction 35 { 36 /** 37 * @var Project 38 */ 39 protected $project; 40 41 function __construct() 42 { 43 parent::__construct(); 44 } 45 46 47 public function init() 48 { 49 $this->project = new Project( $this->request->getId() ); 50 $this->project->load(); 51 52 if ( ! $this->userMayReadProject() ) { 53 throw new SecurityException(); 54 } 55 } 56 57 58 /** 59 * Stellt fest, ob der angemeldete Benutzer Projekt-Admin ist. 60 * Dies ist der Fall, wenn der Benutzer PROP-Rechte im Root-Folder hat. 61 * @return bool|int 62 */ 63 protected function userMayReadProject() { 64 65 $rootFolder = new Folder( $this->project->getRootObjectId() ); 66 67 return $rootFolder->hasRight(Permission::ACL_READ); 68 } 69 70 71 72 /** 73 * User must be an administrator. 74 */ 75 public function checkAccess() { 76 if ( ! $this->userMayReadProject() ) 77 throw new SecurityException(); 78 } 79 80 }
Download modules/cms/action/TaglistAction.class.php
History Thu, 16 Feb 2023 22:57:35 +0100 Jan Dankert New: More functions (adding, deleting) for tags. Thu, 16 Feb 2023 01:04:38 +0100 Jan Dankert New: Tags for base objects.