File modules/cms/action/object/ObjectDelaclAction.class.php

Last commit: Sun Jan 30 23:38:42 2022 +0100	dankert	Refactoring: Only 1 http-endpoint for both the UI and the API. Path "/api" is not available any more, all API data is served under "/".
1 <?php 2 namespace cms\action\object; 3 use cms\action\Action; 4 use cms\action\Method; 5 use cms\action\ObjectAction; 6 use cms\model\Permission; 7 use cms\model\BaseObject; 8 use language\Messages; 9 use util\exception\SecurityException; 10 use util\Http; 11 12 class ObjectDelaclAction extends ObjectAction implements Method { 13 14 public function getRequiredPermission() 15 { 16 return Permission::ACL_GRANT; 17 } 18 19 public function view() { 20 } 21 public function post() { 22 $permission = new Permission($this->request->getText('aclid')); 23 $permission->load(); 24 25 // Nachschauen, ob der Benutzer ueberhaupt berechtigt ist, an 26 // diesem Objekt die ACLs zu aendern. 27 $o = new BaseObject( $permission->objectid ); 28 $o->load(); 29 30 if ( !$o->hasRight( Permission::ACL_GRANT ) ) 31 throw new SecurityException( 'no grant rights' ); // Da wollte uns wohl einer vereimern. 32 33 $permission->delete(); // Weg mit der ACL 34 35 $this->addNoticeFor( $o,Messages::DELETED ); 36 } 37 }
Download modules/cms/action/object/ObjectDelaclAction.class.php
History Sun, 30 Jan 2022 23:38:42 +0100 dankert Refactoring: Only 1 http-endpoint for both the UI and the API. Path "/api" is not available any more, all API data is served under "/". Sun, 5 Dec 2021 22:36:40 +0100 dankert Fixed deleting and inheriting of permissions. Sat, 6 Mar 2021 03:42:38 +0100 Jan Dankert New: Better permission checks. Fri, 26 Feb 2021 01:06:01 +0100 Jan Dankert Refactoring accessing the request parameter values. Mon, 4 Jan 2021 19:03:18 +0100 Jan Dankert Refactoring: ACL class is renamed to Permission, because most RBAC/DMAC concepts are calling it a permission. Thu, 19 Nov 2020 14:49:58 +0100 Jan Dankert Fix: Action::addNotice() is replaced by Action::addNoticeFor() Tue, 17 Nov 2020 23:51:00 +0100 Jan Dankert Refactoring: Every Actionmethod has now its own class.