/**
* @return
*/
public boolean isCurrentUserAnExperimenter() {
UserBean user = (UserBean)JSFUtil.getManagedObject("UserBean");
if( user == null || user.getUserid() == null ) return false;
// Admins can always edit:
if( user.isAdmin() ) return true;
// Check if this user is authorised:
if( this.getExperiment() == null ) return false;
log.info("Exp not null");
if( this.getExperiment().getExperimentSetup() == null ) return false;
log.info("Setup not null");
if( this.getExperiment().getExperimentSetup().getBasicProperties() == null ) return false;
log.info("BasicProp not null");
if( this.getExperiment().getExperimentSetup().getBasicProperties().getInvolvedUserIds() == null ) return false;
log.info("InvolvedUsers not null");
for( String authUser : this.getExperiment().getExperimentSetup().getBasicProperties().getInvolvedUserIds()) {
if( user.getUserid().equals(authUser)) return true;
}
return false;
}