52 private $groupPermissions;
55 private $revokePermissions;
58 private $groupInheritance;
83 $inheritsFrom = $this->groupInheritance[$group] ?? false;
84 $has = isset( $this->groupPermissions[$group][$permission] ) &&
85 $this->groupPermissions[$group][$permission];
88 if ( !$has && $inheritsFrom !==
false ) {
89 $has = isset( $this->groupPermissions[$inheritsFrom][$permission] ) &&
90 $this->groupPermissions[$inheritsFrom][$permission];
98 $revoked = isset( $this->revokePermissions[$group][$permission] ) &&
99 $this->revokePermissions[$group][$permission];
100 if ( !$revoked && $inheritsFrom !==
false ) {
101 $revoked = isset( $this->revokePermissions[$inheritsFrom][$permission] ) &&
102 $this->revokePermissions[$inheritsFrom][$permission];
119 $rights = array_keys( array_filter( $this->groupPermissions[$group] ?? [] ) );
120 $inheritsFrom = $this->groupInheritance[$group] ??
false;
121 if ( $inheritsFrom !==
false ) {
122 $rights = array_merge(
125 array_keys( array_filter( $this->groupPermissions[$inheritsFrom] ?? [] ) )
129 return array_unique( $rights );
140 $rights = array_keys( array_filter( $this->revokePermissions[$group] ?? [] ) );
141 $inheritsFrom = $this->groupInheritance[$group] ??
false;
142 if ( $inheritsFrom !==
false ) {
143 $rights = array_merge(
146 array_keys( array_filter( $this->revokePermissions[$inheritsFrom] ?? [] ) )
150 return array_unique( $rights );
167 foreach ( $groups as $group ) {
168 $checkGroups[] = $group;
169 if ( isset( $this->groupInheritance[$group] ) ) {
170 $checkGroups[] = $this->groupInheritance[$group];
175 foreach ( $checkGroups as $group ) {
176 if ( isset( $this->groupPermissions[$group] ) ) {
177 $rights = array_merge(
180 array_keys( array_filter( $this->groupPermissions[$group] ) )
185 foreach ( $checkGroups as $group ) {
186 if ( isset( $this->revokePermissions[$group] ) ) {
187 $rights = array_diff(
189 array_keys( array_filter( $this->revokePermissions[$group] ) )
193 return array_unique( $rights );
204 $groups = array_unique( array_merge(
205 array_keys( $this->groupPermissions ),
206 array_keys( $this->groupInheritance )
208 foreach ( $groups as $group ) {
209 if ( $this->groupHasPermission( $group, $permission ) ) {
210 $allowedGroups[] = $group;
213 return $allowedGroups;
A class containing constants representing the names of configuration variables.
const GroupInheritsPermissions
Name constant for the GroupInheritsPermissions setting, for use with Config::get()
const RevokePermissions
Name constant for the RevokePermissions setting, for use with Config::get()
const GroupPermissions
Name constant for the GroupPermissions setting, for use with Config::get()