コード例 #1
0
ファイル: MoveFile.aspx.cs プロジェクト: membersuite/portal
    protected void btnMove_Click(object sender, EventArgs e)
    {
        if (!IsValid)
        {
            return;
        }

        string destinationFolderID = ddlDestination.SelectedValue;

        if (destinationFolderID == targetFolder.ID)
        {
            throw new ConciergeClientException(MemberSuite.SDK.Concierge.ConciergeErrorCode.IllegalParameter,
                                               "The source file already resides in the specified folder. Please choose another destination folder.");
        }

        if (!DocumentsLogic.CanWriteTo(LoadObjectFromAPI <msFileFolder>(destinationFolderID), ConciergeAPI.CurrentEntity.ID))
        {
            throw new ConciergeClientException(MemberSuite.SDK.Concierge.ConciergeErrorCode.IllegalParameter,
                                               "You do not have write permission for the destination folder.");
        }

        targetFile.FileFolder = destinationFolderID;
        SaveObject(targetFile);

        GoTo("BrowseFileFolder.aspx?contextID=" + targetFolder.ID, string.Format("File '{0}' has been moved successfully.", targetFile.Name));
    }
コード例 #2
0
ファイル: UploadFile.aspx.cs プロジェクト: membersuite/portal
    protected override bool CheckSecurity()
    {
        if (!base.CheckSecurity())
        {
            return(false);
        }

        return(DocumentsLogic.CanWriteTo(targetFolder, ConciergeAPI.CurrentEntity.ID));
    }
コード例 #3
0
    protected void rptFolders_OnItemCommand(object source, RepeaterCommandEventArgs e)
    {
        var          folderId = e.CommandArgument.ToString();
        msFileFolder f        = LoadObjectFromAPI <msFileFolder>(folderId);

        if (!DocumentsLogic.CanWriteTo(f, ConciergeAPI.CurrentEntity.ID))
        {
            throw new ConciergeClientException(ConciergeErrorCode.AccessDenied, "You do not have access the delete the specified folder.");
        }

        using (var api = GetServiceAPIProxy())
            api.DeleteFolderTree(folderId);


        QueueBannerMessage("The folder (and all subfolders and files) have been successfully deleted.");
        Refresh();
    }
コード例 #4
0
 private void establishWhetherUserHasUploadAccess()
 {
     hasWriteAccess = DocumentsLogic.CanWriteTo(targetFolder, ConciergeAPI.CurrentEntity.ID);
 }