Anonymous avatar Anonymous committed 1a33925

[331] hide icon if no action index access

Comments (0)

Files changed (1)


 				->from( array('P' => 'permission'), array('PermissionId'=>'') )
 				->join( array('M'=>'modules'), ' = P.moduleId', array('moduleId'=>'','moduleName'=>'LOWER(') )
 				->join( array('C'=>'controllers'), ' = P.controllerId', array('controllerId'=>'','controllerName'=>'LOWER(','display'=>'C.display','icon'=>'C.icon') )
-				->join( array('RP'=>'rolePermission'),'',array())
+				->join( array('RP'=>'rolePermission'),'',array())				
 				->where($db->quoteInto('RP.roleId = ?',$roles,'int'))
-				->group('controllerId');			
+				->where( 'C.display=1' )
+				->where( "P.actionId IN(SELECT id FROM actions WHERE name='Index')")
+				->group('controllerId');			 
 			$resultset = $db->query($select);
 			$log = new ZFObserver_Forensic();
 				return $controllers;
 			foreach($resultset as $id=>$value)
-			{
+			{			
 				$controllers[]= array('moduleId'=>$value['moduleId'],'moduleName'=>$value['moduleName'],'controllerId'=>$value['controllerId'],'controllerName'=>$value['controllerName'],'display'=>$value['display'],'icon'=>$value['icon']);
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.