<?php

App::uses('Model', 'Model');

/**
 * Application model for Cake.
 *
 * Add your application-wide methods in the class below, your models
 * will inherit them.
 *
 * @package       app.Model
 */

class Rolepermission extends AppModel { 
	
	function getrolepermission($id,$cont){
		
		$permissionData = $this->query("SELECT r.*,p.controller,p.action FROM `rolepermissions` as r,permissions p where r.permission_id = p.id and r.`role_id`='".$id."' and p.controller='".$cont."'");
		return $permissionData;

	}
    
	function getrolepermissionCont($id,$cont){
		
		$permissionData = $this->query("SELECT p.controller,p.action FROM `rolepermissions` as r,permissions p where r.permission_id = p.id and r.`role_id`='".$id."' and p.controller='".$cont."' ");
		return $permissionData;

	}
	

}