1. Jorge Vazquez
  2. Apmgr

Commits

rne...@debserverp4.com.ar  committed 1a33925

[331] hide icon if no action index access

  • Participants
  • Parent commits 340ae33
  • Branches default

Comments (0)

Files changed (1)

File application/modules/modules/models/Controllers.php

View file
  • Ignore whitespace
 				->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']);
 			}
 		}