Adriano Faria Posted December 7, 2017 Share Posted December 7, 2017 Hi there, Just noticed, after a user report, that one of my apps has no ACP restrictions: Althougt everyhing is there, it doesn't appear. Example: Model: protected static $restrictions = array( 'app' => 'tutorials', 'module' => 'tutorials', 'prefix' => 'categories_' ); Controller: /** * Execute * * @return void */ public function execute() { \IPS\Dispatcher::i()->checkAcpPermission( 'categories_manage' ); parent::execute(); } ACP menu: Editing a menu: acprestrictions.json: { "tutorials": { "categories": { "categories_manage": "categories_manage", "categories_add": "categories_add", "categories_edit": "categories_edit", "categories_delete": "categories_delete", "categories_permissions": "categories_permissions" }, "fields": { "fields_manage": "fields_manage", "fields_add": "fields_add", "fields_edit": "fields_edit", "fields_delete": "fields_delete" }, "tools": { "tools_manage": "tools_manage" }, "settings": { "settings_manage": "settings_manage" } }, "stats": { "tutorials": { "tutorials_manage": "tutorials_manage", "comments_manage": "comments_manage", "submitters_manage": "submitters_manage" } } } Basically, it is like Downloads or any other app I've developed and it works for the others. So debugging IPS\core\modules\admin\applications\developer _manageAcprestrictions() I see the json is OK: So I'm not sure why it doesn't appear. Any suggestion? Link to comment Share on other sites More sharing options...
bfarber Posted December 7, 2017 Share Posted December 7, 2017 Do you have any non-protected admin modules set up in the application? Link to comment Share on other sites More sharing options...
Adriano Faria Posted December 7, 2017 Author Share Posted December 7, 2017 1 hour ago, bfarber said: Do you have any non-protected admin modules set up in the application? Non-protected admin module? Sorry, not following. Link to comment Share on other sites More sharing options...
bfarber Posted December 7, 2017 Share Posted December 7, 2017 public function restrictionsGetRoots() { $rows = array(); if( !empty( $this->modules['admin'] ) ) { foreach ( $this->modules['admin'] as $k => $module ) { if ( empty( $module['protected'] ) ) { $rows[] = $this->_restrictionsModuleRow( $this->url, $k, $this->restrictions, FALSE ); } } } return $rows; } To get the rows to show we loop over admin modules and only show them if the module isn't flagged as protected, that's why I was asking. Link to comment Share on other sites More sharing options...
Adriano Faria Posted December 7, 2017 Author Share Posted December 7, 2017 Tks @bfarber. That was it! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.