1 | <?php |
||
38 | class PermissionsHelper { |
||
39 | |||
40 | private $domElement; |
||
41 | private $skin; |
||
42 | private $default; |
||
43 | |||
44 | /** |
||
45 | * @param \SkinChameleon $skin |
||
46 | * @param DOMElement $domElement |
||
47 | * @param bool $default |
||
48 | */ |
||
49 | public function __construct( \SkinChameleon $skin, DOMElement $domElement = null, $default = false ) { |
||
50 | $this->skin = $skin; |
||
51 | $this->domElement = $domElement; |
||
52 | $this->default = $default; |
||
53 | } |
||
54 | |||
55 | /** |
||
56 | * @since 1.1 |
||
57 | * |
||
58 | * @param string $attributeNameInDomElement |
||
59 | * |
||
60 | * @return bool |
||
61 | */ |
||
62 | public function userHasGroup( $attributeNameInDomElement ) { |
||
66 | |||
67 | /** |
||
68 | * @param string $attributeOfUser |
||
69 | * @param string $attributeNameInDomElement |
||
70 | * |
||
71 | * @throws \MWException |
||
72 | * @return bool |
||
73 | */ |
||
74 | protected function userHas( $attributeOfUser, $attributeNameInDomElement ) { |
||
96 | |||
97 | /** |
||
98 | * @since 1.1 |
||
99 | * |
||
100 | * @param string $attributeNameInDomElement |
||
101 | * |
||
102 | * @return bool |
||
103 | */ |
||
104 | public function hasAttribute( $attributeNameInDomElement ) { |
||
107 | |||
108 | /** |
||
109 | * @param string $attributeName |
||
110 | * |
||
111 | * @return string[] |
||
112 | */ |
||
113 | protected function getValueListFromAttribute( $attributeName ) { |
||
117 | |||
118 | /** |
||
119 | * @since 1.1 |
||
120 | * |
||
121 | * @param string $attributeNameInDomElement |
||
122 | * |
||
123 | * @return bool |
||
124 | */ |
||
125 | public function userHasPermission( $attributeNameInDomElement ) { |
||
129 | |||
130 | /** |
||
131 | * @since 1.1 |
||
132 | * |
||
133 | * @param string $attributeNameInDomElement |
||
134 | * |
||
135 | * @return bool |
||
136 | */ |
||
137 | public function pageIsInNamespace( $attributeNameInDomElement ) { |
||
148 | |||
149 | /** |
||
150 | * @param null|string $value |
||
151 | * |
||
152 | * @return int |
||
153 | */ |
||
154 | protected function getNamespaceNumberFromDefinedConstantName( $value ) { |
||
162 | } |
||
163 |