Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Adriano Faria Posted December 7, 2017 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?
bfarber Posted December 7, 2017 Posted December 7, 2017 Do you have any non-protected admin modules set up in the application?
Adriano Faria Posted December 7, 2017 Author 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.
bfarber Posted December 7, 2017 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.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.