1<?php
2// (c) Copyright by authors of the Tiki Wiki CMS Groupware Project
3//
4// All Rights Reserved. See copyright.txt for details and a complete list of authors.
5// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
6// $Id$
7
8class Perms_Check_Indirect implements Perms_Check
9{
10	private $map;
11
12	function __construct(array $map)
13	{
14		$this->map = $map;
15	}
16
17	function check(Perms_Resolver $resolver, array $context, $name, array $groups)
18	{
19		if (isset($this->map[$name])) {
20			return $resolver->check($this->map[$name], $groups);
21		} else {
22			return false;
23		}
24	}
25
26	function applicableGroups(Perms_Resolver $resolver)
27	{
28		return $resolver->applicableGroups();
29	}
30}
31