Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Adriano Faria Posted June 24, 2019 Posted June 24, 2019 I'm adding a new content moderator permission on my app: public function getPermissions( $toggles ) { $return['can_convert_rev_com'] = 'YesNo'; return $return; } But it is creating a new tab: Shouldn't it add my permisison to the existing CONTENT tab? That way it won't make any difference in use ContentModeratorPermissions or ModeratorPermissions extension. Tks.
bfarber Posted June 24, 2019 Posted June 24, 2019 No, if you create an extension then the permission will be used only in your extension. If you want to add a permission for everything else to use, you should create a hook on the existing Content and/or ContentGenerator extensions.
Adriano Faria Posted June 24, 2019 Author Posted June 24, 2019 1 minute ago, bfarber said: No, if you create an extension then the permission will be used only in your extension. Ok, but what's the difference between them as both you will add a new tab?
newbie LAC Posted June 25, 2019 Posted June 25, 2019 You couldn't add ContentModeratorPermissions extension if you haven't ContentRouter extension with declared classes ContentRouter extension will automaticaly add a tab. Just call it ItemModPermissions Comment $this->classes[] = 'IPS\downloads\File'; in the \applications\downloads\extensions\core\ContentRouter\Files.php Result ContentModeratorPermissions will add new permission(s) to ItemModPermissions Create new for Downloads Result ModeratorPermissions will add a new tab. See Downloads (\applications\downloads\extensions\core\ModeratorPermissions\Files.php) for example. Read also ContentModeratorPermissions -> \IPS\application\Item::modPermission('permission', NULL, $container) -> \IPS\downloads\File::modPermission('hide', NULL, $container) ModeratorPermissions -> \IPS\Member::loggedIn()->modPermission('permission') -> \IPS\Member::loggedIn()->modPermission('can_make_purchasable')
bfarber Posted June 25, 2019 Posted June 25, 2019 I'm not sure I understand the question - sorry. Can you clarify? If you added a plugin on the existing extension, it wouldn't add a new tab (on its own at least). The extension system allows you to define custom/unique permissions for your app. Downloads could have "Can manage revisions" this way, for instance, while still inheriting the global default permission options.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.