public boolean checkPermissions(IClient client, RequestFunction function, AMFDataList params) {
    boolean doesStreamExist = false;
    boolean authorized = false;

    String streamName;
    try {
      streamName = params.getString(PARAM1).split("\\?")[0];
    } catch (Exception ex) {
      return false;
    }

    IMediaStream stream = client.getAppInstance().getStreams().getStream(streamName);

    getLogger().info("Checking stream Name: " + streamName);

    doesStreamExist = (stream != null);

    if (doesStreamExist) {
      authorized = false;
    } else {
      authorized = true;
    }

    // add other permission checking

    getLogger().info("Authorized: " + authorized);

    return authorized;
  }