Skip to content

Fix incorrect implementation of RoleCheckMode.All

Mateusz Brawański requested to merge github/fork/uwx/patch-94 into master

Created by: uwx

Summary

Fixes RequireRoles' RoleCheckMode.All mode's implementation not matching what is implied in the docs.

Details

The mode is incorrectly comparing that all of the member's roles exactly equal the required ones; the docs imply only that the member must have all of the roles, not that they may not have any extra ones. I've fixed the implementation for it, and introduced RoleCheckMode.Pure as a replacement containing the old implementation.

Changes proposed

  • Compare result of intersect against required roles rather than all of member's roles
  • Move old behavior to new enum member RoleCheckMode.Pure

Merge request reports

Loading