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
8/**
9 * Simple factory always providing the same resolver. Used to provide
10 * a grant-all resolver to admin users.
11 */
12class Perms_ResolverFactory_StaticFactory implements Perms_ResolverFactory
13{
14	private $key;
15	private $resolver;
16
17	function __construct($key, $resolver)
18	{
19		$this->key = $key;
20		$this->resolver = $resolver;
21	}
22
23	function bulk(array $baseContext, $bulkKey, array $values)
24	{
25		return [];
26	}
27
28	function getHash(array $context)
29	{
30		return $this->key;
31	}
32
33	function getResolver(array $context)
34	{
35		return $this->resolver;
36	}
37}
38