Package org.olat.core.util.vfs.callbacks

Examples of org.olat.core.util.vfs.callbacks.VFSSecurityCallback


    folderContainer = this.createVelocityContainer("run");
    editQuotaButton = LinkFactory.createButtonSmall("editQuota", folderContainer, this);
   
    BusinessControl bc = getWindowControl().getBusinessControl();
    // --- subscription ---
    VFSSecurityCallback secCallback = VFSManager.findInheritedSecurityCallback(rootContainer);
    if (secCallback != null) {
      subsContext = secCallback.getSubscriptionContext();
      // if null, then no subscription is desired
      if (subsContext != null && (rootContainer instanceof OlatRelPathImpl)) {
        String businessPath = wControl.getBusinessControl().getAsString();
        String data = ((OlatRelPathImpl)rootContainer).getRelPath();
        PublisherData pdata = new PublisherData(OresHelper.calculateTypeName(FolderModule.class), data, businessPath);
View Full Code Here


  private String g_encoding;
 
  private int status = FolderCommandStatus.STATUS_SUCCESS;
 
  public Controller execute(FolderComponent folderComponent, UserRequest ureq, WindowControl wControl, Translator translator) {
    VFSSecurityCallback inheritedSecCallback = VFSManager.findInheritedSecurityCallback(folderComponent.getCurrentContainer());
    if (inheritedSecCallback != null && !inheritedSecCallback.canRead())
      throw new RuntimeException("Illegal read attempt: " + folderComponent.getCurrentContainerPath());
   
    // extract file
    String path = ureq.getModuleURI();
    MediaResource mr = null;
View Full Code Here

            vfsSource.delete();
          }
        }
       
        // after a copy or a move, notify the subscribers
        VFSSecurityCallback secCallback = VFSManager.findInheritedSecurityCallback(folderComponent.getCurrentContainer());
        if (secCallback != null) {
          SubscriptionContext subsContext = secCallback.getSubscriptionContext();
          if (subsContext != null) {
            NotificationsManager.getInstance().markPublisherNews(subsContext, ureq.getIdentity());
          }
        }
        fireEvent(ureq, new FolderEvent(move ? FolderEvent.MOVE_EVENT : FolderEvent.COPY_EVENT, fileSelection.renderAsHtml()));
View Full Code Here

    deletedFilesListTableCtr.addColumnDescriptor(new DefaultColumnDescriptor("version.deletedBy", 2, null, ureq.getLocale()));
    deletedFilesListTableCtr.addColumnDescriptor(new DefaultColumnDescriptor("version.date", 3, null, ureq.getLocale()));
    deletedFilesListTableCtr.addColumnDescriptor(new StaticColumnDescriptor(CMD_DOWNLOAD, "version.download", getTranslator().translate(
        "version.download")));

    VFSSecurityCallback secCallback = VFSManager.findInheritedSecurityCallback(container);
    if (secCallback != null) {
      if (secCallback.canDeleteRevisionsPermanently()) {
        deletedFilesListTableCtr.addMultiSelectAction("delete", CMD_DELETE);
      }
      if (secCallback.canWrite()) {
        deletedFilesListTableCtr.addMultiSelectAction("version.restore", CMD_RESTORE);
      }
    }

    deletedFilesListTableCtr.addMultiSelectAction("cancel", CMD_CANCEL);
View Full Code Here

   *
   * @param container
   * @return Quota if this container has a Quota assigned, null otherwise.
   */
  public static Quota isTopLevelQuotaContainer(VFSContainer container) {
    VFSSecurityCallback callback = container.getLocalSecurityCallback();
    if (callback != null && callback.getQuota() != null) return callback.getQuota();
   
    // extract delegate if this is a NamedContainer instance...
    if (container instanceof NamedContainerImpl) container = ((NamedContainerImpl)container).delegate;
   
    // check if this is a MergeSource with a root write container
View Full Code Here

    OlatNamedContainerImpl namedContainer = BCCourseNode.getNodeFolderContainer(node, courseEnv);
    namedContainer.setLocalSecurityCallback(new ReadOnlyCallback());
    FolderRunController folder = new FolderRunController(namedContainer, false, ureq, getWindowControl());
    previewVC.put("folder", folder.getInitialComponent());
    // get additional infos
    VFSSecurityCallback secCallback = new FolderNodeCallback(namedContainer.getRelPath(), ne, false, false, null);
    previewVC.contextPut("canUpload", Boolean.valueOf(secCallback.canWrite()));
    previewVC.contextPut("canDownload", Boolean.valueOf(secCallback.canRead()));
    Quota q = secCallback.getQuota();
    previewVC.contextPut("quotaKB", (q != null) ? q.getQuotaKB().toString() : "-");
    setInitialComponent(previewVC);
  }
View Full Code Here

      Quota quota = QuotaManager.getInstance().getCustomQuota(namedContainer.getRelPath());
      if (quota == null) {
        Quota defQuota = QuotaManager.getInstance().getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_NODES);
        quota = QuotaManager.getInstance().createQuota(namedContainer.getRelPath(), defQuota.getQuotaKB(), defQuota.getUlLimitKB());
      }
      VFSSecurityCallback secCallback = new FullAccessWithQuotaCallback(quota);
      namedContainer.setLocalSecurityCallback(secCallback);
      CloseableModalController cmc = new CloseableModalController(getWindowControl(), translate("close"),
          new FolderRunController(namedContainer, false, ureq, getWindowControl()).getInitialComponent());
      cmc.activate();
      return;
View Full Code Here

      Quota quota = QuotaManager.getInstance().getCustomQuota(namedContainer.getRelPath());
      if (quota == null) {
        Quota defQuota = QuotaManager.getInstance().getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_NODES);
        quota = QuotaManager.getInstance().createQuota(namedContainer.getRelPath(), defQuota.getQuotaKB(), defQuota.getUlLimitKB());
      }
      VFSSecurityCallback secCallback = new FullAccessWithQuotaCallback(quota);
      namedContainer.setLocalSecurityCallback(secCallback);
      CloseableModalController cmc = new CloseableModalController(getWindowControl(), translate("close"),
        new FolderRunController(namedContainer, false, ureq, getWindowControl()).getInitialComponent());
      cmc.activate();
     
View Full Code Here

    // offer subscription, but not to guests
    SubscriptionContext nodefolderSubContext = (isGuestOnly ? null : CourseModule.createSubscriptionContext(courseEnv, ne.getCourseNode()));

    OlatNamedContainerImpl namedContainer = BCCourseNode.getNodeFolderContainer((BCCourseNode) ne.getCourseNode(), courseEnv);
    VFSSecurityCallback scallback = new FolderNodeCallback(namedContainer.getRelPath(), ne, isOlatAdmin, isGuestOnly, nodefolderSubContext);
    namedContainer.setLocalSecurityCallback(scallback);
    frc = new FolderRunController(namedContainer, false, true, ureq, getWindowControl());
    setInitialComponent(frc.getInitialComponent());
  }
View Full Code Here

      OlatRootFolderImpl rootFolder = new OlatRootFolderImpl(chosenUserFolderRelPath, null);
      OlatNamedContainerImpl namedFolder = new OlatNamedContainerImpl(firstLastName, rootFolder);
     
      //decided in plenum to have read only view in the personal visit card, even for admin
      VFSSecurityCallback secCallback = new ReadOnlyCallback();
      namedFolder.setLocalSecurityCallback(secCallback);
     
      removeAsListenerAndDispose(folderRunController);
      folderRunController = new FolderRunController(namedFolder, false, true, ureq, getWindowControl());
      listenTo(folderRunController);
View Full Code Here

TOP

Related Classes of org.olat.core.util.vfs.callbacks.VFSSecurityCallback

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.