use of app.hongs.HongsExpedient in project HongsCORE by ihongs.
the class JointGate method acting.
@Override
public void acting(ActionHelper helper, ActionRunner runner) throws HongsException {
String act = runner.getHandle();
String ent = runner.getEntity();
String mod = runner.getModule();
try {
// 探测实体是否为独占模块, 方便自动机处理
if (FormSet.hasConfFile(mod + "/" + ent)) {
mod = mod + "/" + ent;
runner.setModule(mod);
}
// 下划线开头的为内部资源, 不直接对外开放
if (ent.startsWith("_")) {
throw new HongsException(0x1100, "Unsupported Request!");
}
// 判断是否禁用了当前动作, 忽略表单不存在
Map fa = FormSet.getInstance(mod).getForm(ent);
Set ca = Synt.toSet(Dict.getDepth(fa, "@", "callable"));
if (ca != null && !ca.contains(act)) {
throw new HongsException(0x1100, "Unsupported Request.");
}
} catch (HongsException | HongsExpedient ex) {
int ec = ex.getErrno();
if (ec != 0x10e8 && ec != 0x10ea) {
throw ex;
}
}
}
Aggregations