Jump to content

Permission Check for ModCpMemberManagement Extension Tabs


Fosters

Recommended Posts

Posted

The ModCp Extensions getTab method allows us to return 'null' if the tab shouldn't be shown.

The ModCpMembers Extensions don't allow us this.

Please implement the ModCpMembers usage the same way, so that we can perform a permission check before we return the tab.

Posted

What files are you looking in? All of the ones inside the ModCp and ModCpMemberManagement all have the getTab method.

If you want to check permissions yourself you can hook into the extensions and overload the getTab method.

Posted

I have created my own ModCpMemberManagement  extension in my application. The getTab method requires you to return a key, unlike the ModCp Extension, which allows getTab to return a key or NULL. If it returns null, the tab won't be shown, which would be useful for the ModCpMemberManagement::getTab method

ModCp:

if( method_exists( $extension, 'getTab' ) )
			{
				$tab = $extension->getTab();
								
				if ( $tab )
				{
					$tabs[ $tab ][] = $key;
				}
			}

ModCpMemberManagement

$tabs[ $extension->getTab() ][] = $key;

 

  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...