<?php
class Permission extends DBObject {
	public function __construct($id) {
		$field="permission_id";
		if (!is_numeric($id)){
			$field="permission_value";
			$id=strtolower($id);
		}
		
		parent::__construct("permissions", $field, $id);
		
		// Hack for MySQL on Linux
		if ($this->PermissionDefaultGrant!='1' && $this->PermissionDefaultGrant!='0')
			$this->PermissionDefaultGrant=ord($this->PermissionDefaultGrant);
	}
}
