Skip to content

Commit

Permalink
fix: add section access if headsplus.section.* is supplied
Browse files Browse the repository at this point in the history
  • Loading branch information
Thatsmusic99 committed Nov 1, 2023
1 parent 76540b7 commit 478f0b9
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -44,8 +44,11 @@ public String getId() {
public List<Content> transformContents(HashMap<String, String> context, Player player) {
List<Content> contents = new ArrayList<>();
ConfigHeadsSelector selector = ConfigHeadsSelector.get();

boolean wildcard = player.isPermissionSet("headsplus.section.*") && player.hasPermission("headsplus.section.*");

for (ConfigHeadsSelector.SectionInfo section : selector.getSections().values()) {
if (!player.hasPermission(section.getPermission())) continue;
if (!wildcard && !player.hasPermission(section.getPermission())) continue;
try {
contents.add(new CustomHeadSection(section.buildSection(), section.getId(), player));
} catch (IllegalStateException ex) {
Expand Down

0 comments on commit 478f0b9

Please sign in to comment.