src/main/java/com/davidcubesvk/repairItem/command/Command.java
/**
     * Returns if the sender has the specified permission (or shortened parent permissions ending with <code>.*</code>).
     * If not, sends the standard no permission message.
     *
     * @return if the sender has any (specified or parent) permission
     */
Returns if the sender has the specified permission (or shortened parent permissions ending with .*).
If not, sends the standard no permission message.

@return if the sender has any (specified or parent) permission
Returns if the sender has the specified permission ( or shortened parent permissions ending with . * ) . If not sends the standard no permission message . @return if the sender has any ( specified or parent ) permission
public boolean hasPermission(CommandSender sender, String permission) {
        boolean hasPermission = false;
        while (permission.contains(".")) {
            hasPermission = sender.hasPermission(permission);
            if (hasPermission) break;
            permission = permission.substring(0, permission.lastIndexOf(".")) + ".*";
        }
        if (!hasPermission)
            sender.sendMessage(ChatColor.translateAlternateColorCodes('&', plugin.getConfiguration().getString(PATH_MAIN + ".no-permission")));
        return hasPermission;
    }
public boolean hasPermission ( CommandSender sender , String permission ) { boolean hasPermission = false ; while ( permission . contains ( "." ) ) { hasPermission = sender . hasPermission ( permission ) ; if ( hasPermission ) break ; permission = permission . substring ( 0 , permission . lastIndexOf ( "." ) ) + ".*" ; } if ( ! hasPermission ) sender . sendMessage ( ChatColor . translateAlternateColorCodes ( '&' , plugin . getConfiguration ( ) . getString ( PATH_MAIN + ".no-permission" ) ) ) ; return hasPermission ; }
Returns if the sender has the specified permission (or shortened parent permissions ending with <code>.*</code>).
Returns if the sender has the specified permission ( or shortened parent permissions ending with <code > . * < / code > ) .
//If has the permission //Check all existing permissions (a.b.c > a.b.* > a.*) //Check the permission //If has, break //Shorten permission check another //Send message if does not have any permission //Send no permission message //Return if has permission