public IdentityAssessmentEditController( WindowControl wControl, UserRequest ureq, StackedController stackPanel, Identity assessedIdentity, ICourse course, boolean mayEdit, boolean headers) { super(ureq, wControl); this.stackPanel = stackPanel; this.mayEdit = mayEdit; main = new Panel("main"); assessedUserCourseEnvironment = AssessmentHelper.createAndInitUserCourseEnvironment(assessedIdentity, course); this.ores = OresHelper.clone(course); this.headers = headers; doIdentityAssessmentOverview(ureq, true); putInitialPanel(main); BusinessControl bc = getWindowControl().getBusinessControl(); ContextEntry ce = bc.popLauncherContextEntry(); if (ce != null) { OLATResourceable oresNode = ce.getOLATResourceable(); if (OresHelper.isOfType(oresNode, CourseNode.class)) { Long courseNodeId = oresNode.getResourceableId(); Structure runStructure = assessedUserCourseEnvironment.getCourseEnvironment().getRunStructure(); CourseNode courseNode = runStructure.getNode(courseNodeId.toString()); if (courseNode instanceof AssessableCourseNode) { doEditNodeAssessment(ureq, (AssessableCourseNode) courseNode); } } } }
/** * @see org.olat.search.service.indexer.Indexer#checkAccess(org.olat.core.id.context.ContextEntry, * org.olat.core.id.context.BusinessControl, org.olat.core.id.Identity, * org.olat.core.id.Roles) */ @Override public boolean checkAccess( final ContextEntry contextEntry, final BusinessControl businessControl, final Identity identity, final Roles roles) { // TODO:chg: check with collabTools if forum is enabled final ContextEntry ce = businessControl.popLauncherContextEntry(); final Long resourceableId = ce.getOLATResourceable().getResourceableId(); final Message message = ForumManager.getInstance().loadMessage(resourceableId); Message threadtop = message.getThreadtop(); if (threadtop == null) { threadtop = message; } final boolean isMessageHidden = Status.getStatus(threadtop.getStatusCode()).isHidden(); // assumes that if is owner then is moderator so it is allowed to see the hidden forum threads // TODO: (LD) fix this!!! // here it is checked if the identity is owner of the forum tool but it has no way to find out // whether is owner of the group that owns the forum tool final boolean isOwner = BaseSecurityManager.getInstance() .isIdentityPermittedOnResourceable( identity, Constants.PERMISSION_ACCESS, contextEntry.getOLATResourceable()); if (isMessageHidden && !isOwner) { return false; } return true; }