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

Last commit: Sun Mar 14 22:29:56 2021 +0100	Jan Dankert	Refactoring: Clearer access check.
1 <?php 2 3 namespace cms\action; 4 5 use cms\model\Folder; 6 use cms\model\Model; 7 use cms\model\Permission; 8 use cms\model\Project; 9 use util\exception\SecurityException; 10 use util\Html; 11 12 // OpenRat Content Management System 13 // Copyright (C) 2002-2012 Jan Dankert, cms@jandankert.de 14 // 15 // This program is free software; you can redistribute it and/or 16 // modify it under the terms of the GNU General Public License 17 // as published by the Free Software Foundation; either version 2 18 // of the License, or (at your option) any later version. 19 // 20 // This program is distributed in the hope that it will be useful, 21 // but WITHOUT ANY WARRANTY; without even the implied warranty of 22 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 // GNU General Public License for more details. 24 // 25 // You should have received a copy of the GNU General Public License 26 // along with this program; if not, write to the Free Software 27 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 28 29 30 /** 31 * Action-Klasse zum Bearbeiten eines Projetmodells 32 * 33 * @author Jan Dankert 34 * @package openrat.actions 35 */ 36 class ModellistAction extends BaseAction 37 { 38 /** 39 * @var Project 40 */ 41 protected $project; 42 43 function __construct() 44 { 45 parent::__construct(); 46 } 47 48 49 public function init() 50 { 51 52 $this->project = new Project( $this->request->getId()); 53 } 54 55 56 /** 57 * User must be an project administrator. 58 */ 59 public function checkAccess() { 60 $rootFolderId = $this->project->getRootObjectId(); 61 62 $rootFolder = new Folder( $rootFolderId ); 63 $rootFolder->load(); 64 65 if ( ! $rootFolder->hasRight( Permission::ACL_PROP ) ) 66 throw new SecurityException(); 67 } 68 69 }
Download modules/cms/action/ModellistAction.class.php
History Sun, 14 Mar 2021 22:29:56 +0100 Jan Dankert Refactoring: Clearer access check. Fri, 26 Feb 2021 01:06:01 +0100 Jan Dankert Refactoring accessing the request parameter values. Wed, 18 Nov 2020 00:18:10 +0100 Jan Dankert Refactoring Part 2: Removing all unnecessary methods in the action base classes. Tue, 17 Nov 2020 23:51:00 +0100 Jan Dankert Refactoring: Every Actionmethod has now its own class. Sat, 26 Sep 2020 04:03:53 +0200 Jan Dankert Refactoring: read language keys with a class. Sun, 23 Feb 2020 04:01:30 +0100 Jan Dankert Refactoring with Namespaces for the cms modules, part 1: moving.