Package org.olat.core.id

Examples of org.olat.core.id.Roles


      //
      String firstItem = publiclyReadableFolders.get(0);
      // If the first value in the list is '*', list all resource folders.
      if (firstItem != null && firstItem.equals("*")) {
        // fake role that represents normally logged in user
        Roles registeredUserRole = new Roles(false, false, false, false, false, false);
        List<RepositoryEntry> allEntries = (List<RepositoryEntry>) repoManager.queryByTypeLimitAccess(SharedFolderFileResource.TYPE_NAME,
            registeredUserRole);
        for (RepositoryEntry entry : allEntries) {
          addReadonlyFolder(rootContainer, entry, sfm, addedEntries);
        }
View Full Code Here


        // I18nManager.getInstance().getDefaultLocale().toString();
        Identity ident = ManagerFactory.getManager().findIdentityByName("administrator");

        usess.signOffAndClear();
        usess.setIdentity(ident);
        usess.setRoles(new Roles(true, true, true, true, false, true));
        usess.setLocale(I18nManager.getInstance().getLocaleOrDefault(ident.getUser().getPreferences().getLanguage()));

        // brasato:: was
        // Windows.getWindows(ureq).getWindowManager().getGlobalSettings().setFontSize(
        // identity.getUser().getPreferences().getFontsize() );
View Full Code Here

  /**
   * @param identity
   * @return The filtered Items
   */
  public List<Item> getFilteredItems(FeedSecurityCallback callback, Identity identity) {
    final Roles roles = ManagerFactory.getManager().getRoles(identity);
    if (roles != null) {
      boolean admin = roles.isOLATAdmin();
      if (admin || isExternal()) {
        // An admin can see all items and everybody can see all items of
        // external feeds
        return items;
      }
View Full Code Here

  public boolean synchronizeLearningGroupsWithIMServer() {
    log.info("Starting synchronisation of LearningGroups with IM server");
    RepositoryManager rm = RepositoryManager.getInstance();
    BGContextManager contextManager = BGContextManagerImpl.getInstance();
    //pull as admin
    Roles roles = new Roles(true, true, true, true, false, true);
    List<RepositoryEntry> allCourses = rm.queryByTypeLimitAccess(CourseModule.getCourseTypeName(), roles);
    int counter = 0;
    for (Iterator<RepositoryEntry> iterator = allCourses.iterator(); iterator.hasNext();) {
      RepositoryEntry entry = iterator.next();
      ICourse course = null;
View Full Code Here

    }
    return selKeys;
  }
 
  private String[] getColsChoiceKeys(UserRequest ureq) { 
    Roles roles = ureq.getUserSession().getRoles();
    boolean isAdministrativeUser = (roles.isAuthor() || roles.isGroupManager() || roles.isUserManager() || roles.isOLATAdmin())
    List<UserPropertyHandler> userPropertyHandlers = UserManager.getInstance().getUserPropertyHandlersFor(usageIdentifyer, isAdministrativeUser);
    Iterator<UserPropertyHandler> propertyIterator =  userPropertyHandlers.iterator();
    ArrayList<String> array = new ArrayList<String>();
    //add username first, next the user properties
    array.add("username");
View Full Code Here

    myContent = createVelocityContainer("panel");   
    readyToDeletePanel = new Panel("readyToDeletePanel");
    readyToDeletePanel.addListener(this);
    myContent.put("panel", readyToDeletePanel);

    Roles roles = ureq.getUserSession().getRoles();
    isAdministrativeUser = (roles.isAuthor() || roles.isGroupManager() || roles.isUserManager() || roles.isOLATAdmin());   
   
    initializeTableController(ureq);
    initializeContent();
    putInitialPanel(myContent);
  }
View Full Code Here

        tableConfig.setTableEmptyMessage(pT.translate("error.no.user.found"));
        tableConfig.setDownloadOffered(false);// no download because user should not download user-list

        if (tableCtr != null) tableCtr.dispose();
        tableCtr = new TableController(tableConfig, ureq, getWindowControl(), pT, this);
        Roles roles = ureq.getUserSession().getRoles();
        boolean isAdministrativeUser = (roles.isAuthor() || roles.isGroupManager() || roles.isUserManager() || roles.isOLATAdmin());
        tdm = new UserTableDataModel(searchUsers(login,  userPropertiesSearch, true), ureq.getLocale(), isAdministrativeUser);
        // add the data column descriptors
        tdm.addColumnDescriptors(tableCtr, null);
        // add the action columns
        if (useMultiSelect) {
View Full Code Here

          }
          selectedIdentities = tdm.getIdentities(tmse.getSelection());
          final UserBulkChangeManager ubcMan = UserBulkChangeManager.getInstance();
          // valid selection: load in wizard
          Step start = new UserBulkChangeStep00(ureq, selectedIdentities);
          Roles roles = ureq.getUserSession().getRoles();
          isAdministrativeUser = (roles.isAuthor() || roles.isGroupManager() || roles.isUserManager() || roles.isOLATAdmin());

          // callback executed in case wizard is finished.
          StepRunnerCallback finish = new StepRunnerCallback() {
            public Step execute(UserRequest ureq1, WindowControl wControl1, StepsRunContext runContext) {
              // all information to do now is within the runContext saved
View Full Code Here

    //  use the PropertyHandlerTranslator  as tableCtr translator
    propertyHandlerTranslator = UserManager.getInstance().getPropertyHandlerTranslator(getTranslator());
   
    myContent = this.createVelocityContainer("deletestatus");
   
    Roles roles = ureq.getUserSession().getRoles();
    isAdministrativeUser = (roles.isAuthor() || roles.isGroupManager() || roles.isUserManager() || roles.isOLATAdmin());   

    userDeleteStatusPanel = new Panel("userDeleteStatusPanel");
    userDeleteStatusPanel.addListener(this);
    myContent.put("userDeleteStatusPanel", userDeleteStatusPanel);
    myContent.contextPut("header", getTranslator().translate("status.delete.email.header",
View Full Code Here

    init(selectButtonLabel, ureq, withCancel, enableDirectLaunch, limitType, limitUser);
  }
 
  private void init(String selectButtonLabel, UserRequest ureq, boolean withCancel, boolean enableDirectLaunch, String limitType, String limitUser) {
    translator = new PackageTranslator(PACKAGE, ureq.getLocale());
    Roles roles = ureq.getUserSession().getRoles();
   
    vc = new VelocityContainer("reposearch", VELOCITY_ROOT + "/search.html", translator, this);
   
    Manager secMgr = ManagerFactory.getManager();
    SecurityGroup usermanagerGroup = secMgr.findSecurityGroupByName(Constants.GROUP_USERMANAGERS);
    boolean isUserManager = secMgr.isIdentityInSecurityGroup(ureq.getIdentity(), usermanagerGroup);

    searchForm = new SearchForm("searchform", translator, withCancel, isUserManager||roles.isOLATAdmin(), limitType, limitUser);
    searchForm.addListener(this);
    searchForm.setVisible(false);
    vc.put("searchform",searchForm);
   
    TableGuiConfiguration tableConfig = new TableGuiConfiguration();
    if (selectButtonLabel != null) tableConfig.setPreferencesOffered(true, "repositorySearchResult");
   
    tableCtr = new TableController(tableConfig, ureq, getWindowControl(), translator, this);
    repoTableModel = new RepositoryTableModel(translator);
    repoTableModel.addColumnDescriptors(tableCtr, selectButtonLabel, enableDirectLaunch);
    tableCtr.addMultiSelectAction("resource.table.select", ACTION_MULTI_SELECT);
    tableCtr.setMultiSelect(true);
    tableCtr.setTableDataModel(repoTableModel);
    tableCtr.setSortColumn(2, true);
    vc.put("repotable", tableCtr.getInitialComponent());

    vc.contextPut("isAuthor", Boolean.valueOf(roles.isAuthor()));
    vc.contextPut("withCancel", Boolean.valueOf(withCancel));
   
    enableBackToSearchFormLink(false); // default, must be enabled explicitly
    enableSearchforAllReferencalbeInSearchForm(false); // default
    setInitialComponent(vc);
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.