Minestom icon indicating copy to clipboard operation
Minestom copied to clipboard

Add a way to override hasPermission method

Open LoisDuplain opened this issue 3 years ago • 2 comments

Permission manager plugins needs to override hasPermission method.

Can be used like any other events:

	public void handlePlayerCheckPermissionEvent(PlayerCheckPermissionEvent event) {
		boolean hasPermission = event.hasPermission();

		if (hasPermission)
			return;
		
		final Player player = event.getPlayer();

		// Your behavior

		event.setHasPermission(/* true or false */);
	}

LoisDuplain avatar Oct 24 '22 12:10 LoisDuplain

I did something similar but for PermissionHandler #1138 Man, it's old now.

HSGamer avatar Nov 12 '22 15:11 HSGamer

@LoisDuplain you should probably address the issues i commented on if you still want this merged (though no guarantee it even will be, since no contributors have commented on this yet)

dev-hydrogen avatar Dec 26 '22 17:12 dev-hydrogen