Anonymous avatar Anonymous committed 1a33925

[331] hide icon if no action index access

Comments (0)

Files changed (1)

application/modules/modules/models/Controllers.php

 				->from( array('P' => 'permission'), array('PermissionId'=>'P.id') )
 				->join( array('M'=>'modules'), 'M.id = P.moduleId', array('moduleId'=>'M.id','moduleName'=>'LOWER(M.name)') )
 				->join( array('C'=>'controllers'), 'C.id = P.controllerId', array('controllerId'=>'C.id','controllerName'=>'LOWER(C.name)','display'=>'C.display','icon'=>'C.icon') )
-				->join( array('RP'=>'rolePermission'),'RP.permissionId=P.id',array())
+				->join( array('RP'=>'rolePermission'),'RP.permissionId=P.id',array())				
 				->where($db->quoteInto('M.name=?',$module,'string'))
 				->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();
 			$log->setStatus(ZFObserver_ILogeable::DEBUG);
 				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 ProjectModifiedEvent.java.
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.