public function isTransitionAllowed(Reference $ref, $transition_name, $state = null, & $access_policy = null)
	{
		if ($state === null) {
			$state = $ref->state;
		}

		if ($transition_name == '') {
			// Read access
			$access_policy = $this->read_access_policy;
			return $this->checkAccessPolicy($this->read_access_policy, $ref);
		} else if (isset($this->actions[$transition_name]['transitions'][$state])) {
			$tr = $this->actions[$transition_name]['transitions'][$state];
			if (isset($tr['access_policy'])) {
				// Transition-specific policy
				$access_policy = $tr['access_policy'];
			} else if (isset($this->actions[$transition_name]['access_policy'])) {
				// Action-specific policy (for all transitions of this name)
				$access_policy = $this->actions[$transition_name]['access_policy'];
			} else {
				// No policy, use default
				$access_policy = $this->default_access_policy;
			}
			return $this->checkAccessPolicy($access_policy, $ref);
		} else {
			// Not a valid transition
			return false;
		}
	}