-
Notifications
You must be signed in to change notification settings - Fork 0
/
Ban.php
77 lines (69 loc) · 1.59 KB
/
Ban.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php namespace mjolnir\access;
/**
* @package mjolnir
* @category Access
* @author Ibidem Team
* @copyright (c) 2012, Ibidem Team
* @license https://github.com/ibidem/ibidem/blob/master/LICENSE.md
*/
class Ban extends \app\Allow
{
/**
* This method accepts both a single array of relays or list of parameters
* representing the array of relays.
*
* @return \mjolnir\types\Protocol
*/
static function relays(/* args... */)
{
$args = \func_get_args();
if (\count($args) == 1 && \is_array($args[0]))
{
$relays = $args[0];
}
else # count != 1 || ! is_array(args[0])
{
$relays = $args;
}
return \app\Protocol::instance()
->relays($relays)
->is('Ban::relay Protocol');
}
/**
* This method accepts both a single array of attributes or list of
* parameters representing the array of attributes.
*
* @return \mjolnir\types\Protocol
*/
static function attrs($relay, array $args)
{
return \app\Protocol::instance()
->relays([$relay])
->attrs($args)
->unrestricted()
->is('Ban::attrs Protocol');
}
/**
This method accepts both a single array of backend or list of
* parameters representing the array of backends.
*
* @return \mjolnir\types\Protocol
*/
static function backend(/* args... */)
{
$args = \func_get_args();
if (\count($args) == 1 && \is_array($args[0]))
{
$relays = $args[0];
}
else # count != 1 || ! is_array(args[0])
{
$relays = $args;
}
return \app\Protocol::instance()
->relays(['mjolnir:backend.route'])
->attrs($args)
->unrestricted()
->is('Ban::backend Protocol');
}
} # class