Package org.olat.core.logging

Examples of org.olat.core.logging.OLATSecurityException


      translator = new PackageTranslator(PACKAGE, I18nModule.getDefaultLocale());
    }
    String uri = req.getRequestURI();
   
    if (!ShibbolethModule.isEnableShibbolethLogins()){
      throw new OLATSecurityException("Got shibboleth request but shibboleth is not enabled: " + uri);
    }
    try uri = URLDecoder.decode(uri, "UTF-8");
    } catch (UnsupportedEncodingException e) {
      throw new AssertException("UTF-8 encoding not supported!!!!");
    }
View Full Code Here


    setBasePackage(this.getClass());
    // Manually set translator that uses a fallback translator to the login module
    // Can't use constructor with fallback translator because it gets overriden by setBasePackage call above
    setTranslator(Util.createPackageTranslator(this.getClass(), ureq.getLocale(), Util.createPackageTranslator(LoginModule.class, ureq.getLocale())));
       
    if (!ShibbolethModule.isEnableShibbolethLogins()) throw new OLATSecurityException("Shibboleth is not enabled.");
   
    loginComp = createVelocityContainer("default_shibbolethlogin");       
    shibLink = LinkFactory.createLink("shib.redirect", loginComp, this)
   
    if (LoginModule.isGuestLoginLinksEnabled()) {
View Full Code Here

        }
      }
    } else if (source == pwLink) {
      // double-check if allowed first
      if (!UserModule.isPwdchangeallowed() || !LDAPLoginModule.isPropagatePasswordChangedOnLdapServer())
        throw new OLATSecurityException("chose password to be changed, but disallowed by config");
      subController = new PwChangeController(ureq, getWindowControl());
      listenTo(subController);
      cmc = new CloseableModalController(getWindowControl(), translate("close"), subController.getInitialComponent());
      cmc.activate();
      listenTo(cmc);
View Full Code Here

      // normal home
      if (ureq.getUserSession().getRoles().isGuestOnly()) return new GuestHomeMainController(ureq, wControl);
      return new HomeMainController(ureq, wControl);

    } else if (OresHelper.isOfType(olatResourceable, BGMainController.class)) {
      if (roles.isGuestOnly()) throw new OLATSecurityException("Tried to launch a BuddyGroupMainController, but is in guest group " + roles);
      return BGControllerFactory.getInstance().createBuddyGroupMainController(ureq, wControl, initialViewIdentifier);

    } else if (OresHelper.isOfType(olatResourceable, BusinessGroup.class)) {
      if (roles.isGuestOnly()) throw new OLATSecurityException("Tried to launch a BusinessGroup, but is in guest group " + roles);
      BusinessGroupManager bgm = BusinessGroupManagerImpl.getInstance();
      BusinessGroup bg = bgm.loadBusinessGroup(olatResourceable.getResourceableId(), exceptIfNoneFound);
      boolean isOlatAdmin = ureq.getUserSession().getRoles().isOLATAdmin();
      // check if allowed to start (must be member or admin)
      if (isOlatAdmin || bgm.isIdentityInBusinessGroup(ureq.getIdentity(), bg)) { 
        // only olatadmins or admins of this group can administer this group
        return BGControllerFactory.getInstance().createRunControllerFor(ureq, wControl, bg, isOlatAdmin,
            initialViewIdentifier);
      }
      // else skip

    } else if (OresHelper.isOfType(olatResourceable, RepositoryEntry.class)) {
      // it this is a respository type, the resourceableID is the repository
      // entry key
      RepositoryManager rm = RepositoryManager.getInstance();
      RepositoryEntry re = rm.lookupRepositoryEntry(olatResourceable.getResourceableId());
      MainLayoutController ctrl = RepositoyUIFactory.createLaunchController(re, initialViewIdentifier, ureq, wControl);
      if (ctrl != null) return ctrl;

    } else if (OresHelper.isOfType(olatResourceable, CourseModule.class)) {
      // gets called by subscription launcher
      //FIXME:fj:make it clearer here: subscriptioncontext is always given by
      // the surrounding resource, but for launching we always need the
      // repoentry
      // if it is a course, we also take the repository entry, since a course
      // can only be called by a repoentry
      RepositoryManager rm = RepositoryManager.getInstance();
      RepositoryEntry re = rm.lookupRepositoryEntry(olatResourceable, false);
      MainLayoutController ctrl = RepositoyUIFactory.createLaunchController(re, initialViewIdentifier, ureq, wControl);
      if (ctrl != null) return ctrl;
    } else if (OresHelper.isOfType(olatResourceable, AssessmentManager.class)) {
      // gets called by subscription launcher
      //FIXME:fj:make it clearer here: subscriptioncontext is always given by
      // the surrounding resource, but for launching we always need the
      // repoentry
      // if it is a course, we also take the repository entry, since a course
      // can only be called by a repoentry
      RepositoryManager rm = RepositoryManager.getInstance();
      // launch course with view identifyer assessment tool. however notifications
      // publisher data provides not existing assessmentManager resource
      OLATResourceable fakedCourseResource = OresHelper.createOLATResourceableInstance(CourseModule.class, olatResourceable.getResourceableId());
      RepositoryEntry re = rm.lookupRepositoryEntry(fakedCourseResource, false);
      MainLayoutController ctrl = RepositoyUIFactory.createLaunchController(re, "assessmentTool", ureq, wControl);
     
      if (ctrl != null) return ctrl;
    } else if (OresHelper.isOfType(olatResourceable, DropboxController.class)) {
      // JumpIn-handling for task-dropbox notification
      RepositoryManager rm = RepositoryManager.getInstance();
      OLATResourceable fakedCourseResource = OresHelper.createOLATResourceableInstance(CourseModule.class, olatResourceable.getResourceableId());
      RepositoryEntry re = rm.lookupRepositoryEntry(fakedCourseResource,false);
      if (re == null) {
        return null;// found no repositoryEntry => return null
      }
      MainLayoutController ctrl = RepositoyUIFactory.createLaunchController(re, "assessmentTool:nodeChoose", ureq, wControl)
      if (ctrl != null) return ctrl;
    } else if (OresHelper.isOfType(olatResourceable, ReturnboxController.class)) {
      // JumpIn-handling for task-returnbox notification
      RepositoryManager rm = RepositoryManager.getInstance();
      OLATResourceable fakedCourseResource = OresHelper.createOLATResourceableInstance(CourseModule.class, olatResourceable.getResourceableId());
      RepositoryEntry re = rm.lookupRepositoryEntry(fakedCourseResource, false);
      MainLayoutController ctrl = RepositoyUIFactory.createLaunchController(re, initialViewIdentifier, ureq, wControl)
      if (ctrl != null) return ctrl;
    }

    // --- repository ---
    else if (OresHelper.isOfType(olatResourceable, RepositoryMainController.class)) {
      return new RepositoryMainController(ureq, wControl);
    }
    // --- home ---
    else if (OresHelper.isOfType(olatResourceable, HomeMainController.class)) {
      if (roles.isGuestOnly()) throw new OLATSecurityException("Tried to launch a HomeMainController, but is in guest group " + roles);
      return new HomeMainController(ureq, wControl);
    } else if (OresHelper.isOfType(olatResourceable, SystemAdminMainController.class)) {
      if (!roles.isOLATAdmin()) throw new OLATSecurityException("Tried to launch a SystemAdminMainController, but is not in admin group " + roles);
      return new SystemAdminMainController(ureq, wControl);
    } else if (OresHelper.isOfType(olatResourceable, UserAdminMainController.class)) {
      if (!roles.isUserManager()) throw new OLATSecurityException("Tried to launch a UserAdminMainController, but is not in admin group " + roles);
      return new UserAdminMainController(ureq, wControl);
    } else if (OresHelper.isOfType(olatResourceable, BGContextManagementController.class)) {
      if (!roles.isGroupManager()) throw new OLATSecurityException("Tried to launch a BGContextManagementController, but is not in group groupmanager "
          + roles);
      return new BGContextManagementController(ureq, wControl);
    } else if (OresHelper.isOfType(olatResourceable, GuestHomeMainController.class)) {
      if (!roles.isGuestOnly()) throw new OLATSecurityException("Tried to launch a GuestMainController, but is not in guest group " + roles);
      return new GuestHomeMainController(ureq, wControl);
    } else if (OresHelper.isOfType(olatResourceable, GUIDemoMainController.class)) {
      if (!roles.isOLATAdmin()) throw new OLATSecurityException("Tried to launch a GUIDemoMainController, but is not in admin group "
          + roles);
      return new GUIDemoMainController(ureq, wControl);
    } else { // ask the handlerfactory of the repository if it can handle it
      // a repository entry ?
      RepositoryManager rm = RepositoryManager.getInstance();
View Full Code Here

    if (sub == null) { // the subscription does not exist anymore
      return null;
    }
    Identity owner = sub.getIdentity();
    Identity requestor = ureq.getIdentity();
    if (!owner.equalsByPersistableKey(requestor)) throw new OLATSecurityException("tried to access subscription sub, key:" + sub.getKey()
        + ", owner is :" + owner.getName() + ", but was requested by " + requestor.getName());

    Publisher pub = sub.getPublisher();
   
    final OLATResourceable ores = OresHelper.createOLATResourceableInstance(pub.getResName(), pub.getResId());
View Full Code Here

  /**
   * @see org.olat.gui.control.generic.portal.AbstractPortlet#createInstance(org.olat.gui.control.WindowControl, org.olat.gui.UserRequest, java.util.Map)
   */
  public Portlet createInstance(WindowControl wControl, UserRequest ureq, Map configuration) {
    if (!ShibbolethModule.isEnableShibbolethLogins())
      throw new OLATSecurityException("Got shibboleth wayf form request but shibboleth is not enabled.");   
    ShibLoginPortlet p = new ShibLoginPortlet();
    p.setConfiguration(configuration);
    p.setTranslator(new PackageTranslator(Util.getPackageName(ShibLoginPortlet.class), ureq.getLocale()));
    // override css class if configured
    String cssClass = (String)configuration.get("cssWrapperClass");
View Full Code Here

TOP

Related Classes of org.olat.core.logging.OLATSecurityException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.