LoginSystem/src/main/java/fr/xephi/authme/permission/PermissionsService.java
ljacqu 2f153fb85c #305 Modularize logic / separate from data classes (wip – doesn't compile)
- Remove permission logic on command side; make PermissionsManager handle checks for all CommandSender objects (not only Player), cf. #314
- Remove unnecessary redundancies in passed arguments ("command references" that can be inferred from the FoundResult)
- Extend FoundCommandResult to represent all possible error cases
2015-12-12 00:43:55 +01:00

41 lines
1.2 KiB
Java

package fr.xephi.authme.permission;
import fr.xephi.authme.command.CommandDescription;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
/**
* Interface for dealing with permissions.
*/
public interface PermissionsService {
/**
* Check if the player has the given permission.
*
* @param sender The command sender
* @param permission The permission node to check
* @param def Default returned if no permissions system is used
*
* @return True if the player has permission
*/
boolean hasPermission(CommandSender sender, PermissionNode permission, boolean def);
/**
* Check if the player has the permissions for the given command.
*
* @param sender The command sender
* @param command The command whose permissions should be checked
*
* @return True if the player may execute the command
*/
boolean hasPermission(CommandSender sender, CommandDescription command);
/**
* Return the permission system the service is working with.
*
* @return The permission system AuthMe is hooked into
*/
PermissionsSystemType getSystem();
}