@Atomic public void createNewPeriod() { final User userView = Authenticate.getUser(); if (userView != null && RoleType.MANAGER.isMember(userView.getPerson().getUser())) { if (title != null && title.hasContent() && start != null && end != null) { new GenericApplicationPeriod(title, description, start, end); } } }
@Override public boolean evaluate(Context context) { User user = Authenticate.getUser(); if (RoleType.SCIENTIFIC_COUNCIL.isMember(user)) { return true; } final DegreeCurricularPlan parentDegreeCurricularPlan = context.getParentCourseGroup().getParentDegreeCurricularPlan(); if (!parentDegreeCurricularPlan.isBolonhaDegree()) { return true; } if (AcademicAuthorizationGroup.get(AcademicOperationType.MANAGE_DEGREE_CURRICULAR_PLANS) .isMember(user) || RoleType.MANAGER.isMember(user) || RoleType.OPERATOR.isMember(user)) { return true; } return parentDegreeCurricularPlan.getCurricularPlanMembersGroup().isMember(user); }