Class PermissionUtil

java.lang.Object
discord4j.core.util.PermissionUtil

public final class PermissionUtil extends Object
  • Constructor Details

    • PermissionUtil

      public PermissionUtil()
  • Method Details

    • computeBasePermissions

      public static PermissionSet computeBasePermissions(PermissionSet everyonePerms, List<PermissionSet> rolePerms)
      Computes the permissions granted by a member's roles.
      Parameters:
      everyonePerms - The permissions granted by the everyone role.
      rolePerms - The list of permissions granted by each of the member's other roles.
      Returns:
      The combined permissions of everyonePerms and rolePerms.
      See Also:
    • computePermissions

      public static PermissionSet computePermissions(PermissionSet base, @Nullable PermissionOverwrite everyoneOverwrite, List<PermissionOverwrite> roleOverwrites, @Nullable PermissionOverwrite memberOverwrite)
      Computes the permissions of a member taking into account permission overwrites.
      Parameters:
      base - The base permissions granted by the member's roles.
      everyoneOverwrite - The overwrite applied to the everyone role in the channel.
      roleOverwrites - The overwrites applied to every other role in the channel.
      memberOverwrite - The overwrite applied to the member in the channel.
      Returns:
      The permissions with overwrites taken into account.
      See Also: