<?PHP

class permissions_SQL extends SqlRequest{

	var $table = 'permissions';

	function permissions($add_sql = '', $execute = false){

		$this->LINE = __FILE__.' '.__LINE__;
		return $this->Select("select * from ".$this->table." ".
			$add_sql,
			$execute
		);
	}

	function permissions_and_roles($add_sql = '', $execute = false){

		$this->LINE = __FILE__.' '.__LINE__;
		return $this->Select("select p1.*, p2.name from ".$this->table." as p1 ".
			"join roles as p2 on p2.id = p1.role_id ".
			$add_sql,
			$execute
		);
	}
}
?>