import org.splat.dal.bo.som.ProjectElement;
import org.splat.dal.bo.som.Scenario;
import org.splat.dal.bo.som.Study;
+import org.splat.service.ServiceLocatorImpl;
public class StepRights {
private User user;
private Step operand;
-
-// ==============================================================================================================================
-// Construction
-// ==============================================================================================================================
-
- public StepRights (User user, Step step) {
+ public StepRights (User user, Step step) {
// ----------------------------------------
this.user = user;
this.operand = step;
public boolean canAddComment () {
// -------------------------------
Study owner = operand.getOwnerStudy();
- return (owner.getAuthor().equals(user) || owner.hasActor(user));
+ return (owner.getAuthor().equals(user) || ServiceLocatorImpl.getInstance().getStudyService().hasActor(owner, user));
}
/**
public boolean canCreateDocument () {
// -----------------------------------
if (!isEnabled()) return false;
- return operand.getOwnerStudy().isStaffedBy(user);
+ return ServiceLocatorImpl.getInstance().getStudyService().isStaffedBy(operand.getOwnerStudy(), user);
}
/**
*/
public boolean canCreateKnowledge () {
// ------------------------------------
- return operand.getOwnerStudy().isStaffedBy(user);
+ return ServiceLocatorImpl.getInstance().getStudyService().isStaffedBy(operand.getOwnerStudy(), user);
}
/**
public boolean canEditSimulationContext () {
// ------------------------------------------
Study owner = operand.getOwnerStudy();
- return (owner.getAuthor().equals(user) || owner.hasActor(user));
+ return (owner.getAuthor().equals(user) || ServiceLocatorImpl.getInstance().getStudyService().hasActor(owner, user));
}
/**