Package org.olat.core.id

Examples of org.olat.core.id.Roles


  /**
   * @return Roles
   */
  public Roles getRoles() {
    Roles result = identityEnvironment.getRoles();
    if (result==null) {
      Tracing.logWarn("getRoles: null, this="+this, new RuntimeException("getRoles"), UserSession.class);
    }
    return result;
  }
View Full Code Here


    Tracing.logAudit("All sessions were invalidated by an administrator", UserSession.class);
    //clusterNOK ?? invalidate only locale sessions ?
    Set iterCopy = new HashSet(authUserSessions);
    for (Iterator iterator = iterCopy.iterator(); iterator.hasNext();) {
      UserSession userSession = (UserSession) iterator.next();
      Roles userRoles = userSession != null ? userSession.getRoles() : null;
      if (userRoles != null && !userRoles.isOLATAdmin()) {
        //do not logout administrators
        try {
          userSession.signOffAndClear();
          invalidateCounter++;
        } catch(Exception ex) {
View Full Code Here

      || ! ureq.getUserSession().isAuthenticated()
      || contextHelpPageVC == null ) return;
   
    CommentAndRatingService commentAndRatingService = (CommentAndRatingService) ServiceFactory.getServiceOrNull(CommentAndRatingService.class);
    if (commentAndRatingService != null) {       
      Roles roles = ureq.getUserSession().getRoles();
      OLATResourceable helpOres = OresHelper.createOLATResourceableType("contexthelp");
      String key = ContextHelpManager.getInstance().calculateCombinedKey(pageTranslator.getLocale(), bundleName, page);
      commentAndRatingService.init(getIdentity(), helpOres, key, roles.isOLATAdmin(), roles.isGuestOnly());
      UserCommentsAndRatingsController commentsAndRatingCtr = commentAndRatingService.createUserCommentsAndRatingControllerExpandable(ureq, getWindowControl());
      listenTo(commentsAndRatingCtr);
      contextHelpWrapperVC.put("commentsAndRatingCtr", commentsAndRatingCtr.getInitialComponent());   
    }
  }
View Full Code Here

    if (allowsGuestAccess(course)) {
      hasAccess = true;
    } else {
      IdentityEnvironment ienv = new IdentityEnvironment();
      ienv.setIdentity(identity);
      Roles roles = ManagerFactory.getManager().getRoles(identity);
      ienv.setRoles(roles);
      UserCourseEnvironment userCourseEnv = new UserCourseEnvironmentImpl(ienv, course.getCourseEnvironment());
      // Build an evaluation tree
      TreeEvaluation treeEval = new TreeEvaluation();
      NodeEvaluation nodeEval = node.eval(userCourseEnv.getConditionInterpreter(), treeEval);
View Full Code Here

    if (allowsGuestAccess(feed)) {
      hasAccess = true;
    } else if (identity != null) {
      RepositoryManager resMgr = RepositoryManager.getInstance();
      RepositoryEntry repoEntry = resMgr.lookupRepositoryEntry(feed, false);
      Roles roles = ManagerFactory.getManager().getRoles(identity);
      boolean isAllowedToLaunch = resMgr.isAllowedToLaunch(identity, roles, repoEntry);
      if (isAllowedToLaunch && validAuthentication(identity, token)) {
        hasAccess = true;
      }
    }
View Full Code Here

   * Loops over all repository-entries. Index repository meta data.
   * Go further with repository-indexer for certain type if available.
   * @see org.olat.search.service.indexer.Indexer#doIndex(org.olat.search.service.SearchResourceContext, java.lang.Object, org.olat.search.service.indexer.OlatFullIndexer)
   */
  public void doIndex(SearchResourceContext parentResourceContext, Object businessObj, OlatFullIndexer indexWriter) throws IOException,InterruptedException {
    Roles roles = new Roles(true, true, true, true, false, true);
    int counter = 0;
    List repositoryList = repositoryManager.genericANDQueryWithRolesRestriction(null,null,null,null,roles, null);
    if (Tracing.isDebugEnabled(RepositoryIndexer.class)) Tracing.logDebug("RepositoryIndexer repositoryList.size=" + repositoryList.size(), RepositoryIndexer.class);
    // loop over all repository-entries
    Iterator iter = repositoryList.iterator();
View Full Code Here

    final String title = course.getCourseTitle();

    simCourseEnv = new PreviewCourseEnvironment(title, runStructure, psf.getDate(), course.getCourseFolderContainer(), course
        .getCourseBaseContainer(),course.getResourceableId(), cpm, cgm, auditman, am);
    simIdentEnv = new IdentityEnvironment();
    simIdentEnv.setRoles(new Roles(false, false, false, isGlobalAuthor, isGuestOnly, false));
    final Identity ident = new PreviewIdentity();
    simIdentEnv.setIdentity(ident);
    //identity must be set before attributes OLAT-4811
    simIdentEnv.setAttributes(psf.getAttributesMap());
  }
View Full Code Here

      userDataVC.contextPut("courseTitle", efficiencyStatement.getCourseTitle() + " (" + efficiencyStatement.getCourseRepoEntryKey().toString() + ")");
      userDataVC.contextPut("user", ureq.getIdentity().getUser());     
      userDataVC.contextPut("username", ureq.getIdentity().getName());
      userDataVC.contextPut("date", StringHelper.formatLocaleDateTime(efficiencyStatement.getLastUpdated(), ureq.getLocale()));
     
      Roles roles = ureq.getUserSession().getRoles();
      boolean isAdministrativeUser = (roles.isAuthor() || roles.isGroupManager() || roles.isUserManager() || roles.isOLATAdmin())
      List<UserPropertyHandler> userPropertyHandlers = UserManager.getInstance().getUserPropertyHandlersFor(usageIdentifyer, isAdministrativeUser);
      userDataVC.contextPut("userPropertyHandlers", userPropertyHandlers);
     
      Controller identityAssessmentCtr = new IdentityAssessmentOverviewController(ureq, wControl, efficiencyStatement.getAssessmentNodes());
      listenTo(identityAssessmentCtr);//dispose it when this one is disposed
View Full Code Here

   * @param restrictedType
   * @param roles
   * @return Results
   */
  public List queryByTypeLimitAccess(String restrictedType, UserRequest ureq) {
    Roles roles = ureq.getUserSession().getRoles();
    String institution = "";
    institution = ureq.getIdentity().getUser().getProperty("institutionalName", null);
    if(!roles.isOLATAdmin() && institution != null && institution.length() > 0 && roles.isInstitutionalResourceManager()) {
      StringBuilder query = new StringBuilder(400);
      query.append("select distinct v from org.olat.repository.RepositoryEntry v inner join fetch v.olatResource as res"
          + ", org.olat.basesecurity.SecurityGroupMembershipImpl as sgmsi"
          + ", org.olat.basesecurity.IdentityImpl identity"
          + ", org.olat.user.UserImpl user "
View Full Code Here

              usess = UserSession.getUserSession(request);
              usess.signOffAndClear();
              usess.setIdentity(identity);
              UserDeletionManager.getInstance().setIdentityAsActiv(identity);
              // set the roles (admin, author, guest)
              Roles roles = ManagerFactory.getManager().getRoles(identity);
              usess.setRoles(roles);
              // set authprovider
              //usess.getIdentityEnvironment().setAuthProvider(OLATAuthenticationController.PROVIDER_OLAT);
           
              // set session info
View Full Code Here

TOP

Related Classes of org.olat.core.id.Roles

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.