public SDMSGroup create(SystemEnvironment env, String p_name, Long p_deleteVersion) throws SDMSException { Long p_creatorUId = env.cEnv.uid(); Long p_createTs = env.txTime(); Long p_changerUId = env.cEnv.uid(); Long p_changeTs = env.txTime(); if (env.tx.mode == SDMSTransaction.READONLY) { throw new FatalException(new SDMSMessage(env, "01110182049", "Group")); } validate(env, p_name, p_deleteVersion, p_creatorUId, p_createTs, p_changerUId, p_changeTs); env.tx.beginSubTransaction(env); SDMSGroupGeneric o = new SDMSGroupGeneric( env, p_name, p_deleteVersion, p_creatorUId, p_createTs, p_changerUId, p_changeTs); SDMSGroup p; try { env.tx.addToChangeSet(env, o.versions, true); env.tx.addToTouchSet(env, o.versions, true); table.put(env, o.id, o.versions); env.tx.commitSubTransaction(env); p = (SDMSGroup) (o.toProxy()); p.current = true; } catch (SDMSException e) { p = (SDMSGroup) (o.toProxy()); p.current = true; env.tx.rollbackSubTransaction(env); throw e; } if (!checkCreatePrivs(env, p)) throw new AccessViolationException(p.accessViolationMessage(env, "01402270738")); return p; }
protected boolean checkCreatePrivs(SystemEnvironment env, SDMSGroup p) throws SDMSException { if (!p.checkPrivileges(env, SDMSPrivilege.CREATE)) return false; return true; }