Search in sources :

Example 1 with CachedPermissionData

use of net.luckperms.api.cacheddata.CachedPermissionData in project AuthMeReloaded by AuthMe.

the class LuckPermsHandler method hasPermissionOffline.

@Override
public boolean hasPermissionOffline(String name, PermissionNode node) {
    User user = luckPerms.getUserManager().getUser(name);
    if (user == null) {
        logger.warning("LuckPermsHandler: tried to check permission for offline user " + name + " but it isn't loaded!");
        return false;
    }
    CachedPermissionData permissionData = user.getCachedData().getPermissionData(QueryOptions.builder(QueryMode.CONTEXTUAL).build());
    return permissionData.checkPermission(node.getNode()).asBoolean();
}
Also used : User(net.luckperms.api.model.user.User) CachedPermissionData(net.luckperms.api.cacheddata.CachedPermissionData)

Aggregations

CachedPermissionData (net.luckperms.api.cacheddata.CachedPermissionData)1 User (net.luckperms.api.model.user.User)1