|
MediaWiki master
|
A service to check whether a user can be added or removed to/from restricted user groups. More...
Public Member Functions | |
| __construct (ServiceOptions $options, private readonly UserRequirementsConditionChecker $userRequirementsConditionChecker,) | |
| canPerformerAddTargetToGroup (Authority $performer, UserIdentity $target, string $groupName) | |
| Checks whether the performer can add the target to the given restricted group. | |
| canPerformerIgnoreGroupRestrictions (Authority $performer, string $groupName) | |
| Returns true if the performer can ignore the conditions for adding or removing users to/from the given group. | |
| doPerformerAndTargetMeetConditionsForAddingToGroup (UserIdentity $performer, UserIdentity $target, string $groupName) | |
| Checks whether both the performer and the target meet the conditions required for adding the target to the given restricted group. | |
| isGroupRestricted (string $groupName) | |
| Checks whether the given group is restricted. | |
Public Attributes | |
| const | CONSTRUCTOR_OPTIONS |
A service to check whether a user can be added or removed to/from restricted user groups.
It checks only the restrictions defined for the group and does not perform any other permission checks.
Definition at line 19 of file RestrictedUserGroupChecker.php.
| MediaWiki\User\RestrictedUserGroupChecker::__construct | ( | ServiceOptions | $options, |
| private readonly UserRequirementsConditionChecker | $userRequirementsConditionChecker ) |
Definition at line 29 of file RestrictedUserGroupChecker.php.
References MediaWiki\Config\ServiceOptions\assertRequiredOptions(), MediaWiki\Config\ServiceOptions\get(), and MediaWiki\MainConfigNames\RestrictedGroups.
| MediaWiki\User\RestrictedUserGroupChecker::canPerformerAddTargetToGroup | ( | Authority | $performer, |
| UserIdentity | $target, | ||
| string | $groupName ) |
Checks whether the performer can add the target to the given restricted group.
Note: This method only tests against the restrictions defined for the group. It doesn't take into account other permission checks that may apply (e.g., whether the performer has the right to edit user groups at all).
Definition at line 51 of file RestrictedUserGroupChecker.php.
| MediaWiki\User\RestrictedUserGroupChecker::canPerformerIgnoreGroupRestrictions | ( | Authority | $performer, |
| string | $groupName ) |
Returns true if the performer can ignore the conditions for adding or removing users to/from the given group.
This is the case if the group allows ignoring restrictions and the performer has the 'ignore-restricted-groups' permission.
Definition at line 90 of file RestrictedUserGroupChecker.php.
| MediaWiki\User\RestrictedUserGroupChecker::doPerformerAndTargetMeetConditionsForAddingToGroup | ( | UserIdentity | $performer, |
| UserIdentity | $target, | ||
| string | $groupName ) |
Checks whether both the performer and the target meet the conditions required for adding the target to the given restricted group.
Note: Even if this method returns false, the performer may still be allowed to add the target to the group if they can ignore group restrictions (use {
Definition at line 73 of file RestrictedUserGroupChecker.php.
| MediaWiki\User\RestrictedUserGroupChecker::isGroupRestricted | ( | string | $groupName | ) |
Checks whether the given group is restricted.
A group is considered restricted if it has an entry defined in $wgRestrictedGroups (even if its value would be an empty array).
Definition at line 41 of file RestrictedUserGroupChecker.php.
| const MediaWiki\User\RestrictedUserGroupChecker::CONSTRUCTOR_OPTIONS |
Definition at line 22 of file RestrictedUserGroupChecker.php.