code: public boolean isAuthorized(ChargingStationId chargingStationId, UserIdentity userIdentity, Class commandClass) {
          // first search for this specific authorization
          boolean isAuthorized = commandAuthorizationRepository.find(chargingStationId.getId(), userIdentity.getId(), commandClass) != null;
  
          if (!isAuthorized) {
              // maybe the user identity has access to 'allPermissions'
              isAuthorized = commandAuthorizationRepository.find(chargingStationId.getId(), userIdentity.getId(), AllPermissions.class) != null;
          }
  
          return isAuthorized;
      }
docs: Checks if a user identity has access to a command class for a certain charging station.
  
  @param chargingStationId    charging station identification.
  @param userIdentity         user identity.
  @param commandClass         command class.
  @return true if the user is authorized to execute the command for the charging station, false if not.