int getPermission(Responder responder)

Source

int getPermission(Responder responder) {
  // TODO Permission temp workaround before user permission is implemented
  if (_FORCE_CONFIG) {
    return Permission.CONFIG;
  }
  if (idMatchs.containsKey(responder.reqId)) {
    return idMatchs[responder.reqId];
  }

  int rslt = Permission.NEVER;
  for (String group in responder.groups) {
    if (groupMatchs.containsKey(group)) {
      int v = groupMatchs[group];
      if (v < rslt) {
        // choose the lowest permission from all matched group
        rslt = v;
      }
    }
  }

  if (rslt == Permission.NEVER) {
    return defaultPermission;
  }
  return rslt;
}