use of com.runwaysdk.session.Request in project geoprism-registry by terraframe.
the class BusinessTypeService method edit.
@Request(RequestType.SESSION)
public JsonObject edit(String sessionId, String oid) {
BusinessType type = BusinessType.get(oid);
type.lock();
return type.toJSON(true);
}
use of com.runwaysdk.session.Request in project geoprism-registry by terraframe.
the class BusinessTypeService method apply.
/**
* Creates a {@link BusinessType} from the given JSON.
*
* @param sessionId
* @param ptJSON
* JSON of the {@link BusinessType} to be created.
* @return newly created {@link BusinessType}
*/
@Request(RequestType.SESSION)
public JsonObject apply(String sessionId, String ptJSON) {
BusinessType type = BusinessType.apply(JsonParser.parseString(ptJSON).getAsJsonObject());
((Session) Session.getCurrentSession()).reloadPermissions();
return type.toJSON();
}
use of com.runwaysdk.session.Request in project geoprism-registry by terraframe.
the class BusinessTypeService method unlock.
@Request(RequestType.SESSION)
public void unlock(String sessionId, String oid) {
BusinessType type = BusinessType.get(oid);
type.unlock();
}
use of com.runwaysdk.session.Request in project geoprism-registry by terraframe.
the class ChangeRequestService method deleteChangeRequest.
@Request(RequestType.SESSION)
public String deleteChangeRequest(String sessionId, String requestId) {
ChangeRequest request = ChangeRequest.get(requestId);
if (!this.permService.getPermissions(request).containsAll(Arrays.asList(ChangeRequestPermissionAction.DELETE))) {
throw new CGRPermissionException();
}
request.delete();
return requestId;
}
use of com.runwaysdk.session.Request in project geoprism-registry by terraframe.
the class ChangeRequestService method setActionStatus.
@Request(RequestType.SESSION)
public void setActionStatus(String sessionId, String actionOid, String status) {
AbstractAction action = AbstractAction.get(actionOid);
if (!this.permService.getPermissions(action.getAllRequest().next()).containsAll(Arrays.asList(ChangeRequestPermissionAction.WRITE_APPROVAL_STATUS))) {
throw new CGRPermissionException();
}
action.appLock();
action.clearApprovalStatus();
action.addApprovalStatus(AllGovernanceStatus.valueOf(status));
action.apply();
}
Aggregations