'read mode' for a gallery?

Last post 05-08-2011, 11:15 PM by Jeff. 1 replies.
Sort Posts: Previous Next
  •  05-06-2011, 6:34 PM 67463

    'read mode' for a gallery?

    We are using CuteEditor to allow users to build a blog that contains photos.
     
    In order to do that, they need to be able to upload photos.  Now obviously, I don't want one user to update a second users photos.  So every person gets their own gallery library.  That worked perfectly, I do that through the ASP.NET interface that allows me to specify a specific folder for the gallery.
     
    Now we have a need for some common photos that they can pull down for 'favorites'.  So there is a 'common library' that they can use to pull pictures for their profile. So the way I have it set up now, is there are 2 libraries in the gallery (separated by the '|').  A 'common' library, and their 'personal' library.  Again, works perfectly.  Well, almost.
     
    We have a situation where people are accidently uploading to the 'common' library instead of their 'personal' library.  I would like to set the 'common' library up as 'read only', but leave the 'personal' library as 'read/write'.
     
    Now, I know your initial response is to just handle this through Windows Security, and block the ASP.NET userid from having write access.  Well, there are 2 problems with that.
     
    #1) We update the common library through the admin interface.   So that interface must have 'read/write' access to the library.   I can use impersonation on the admin side, impersonate a windows user with write access, and I can get around this issue.  While I don't like doing this, it does work.  If this were my only issue, I would be fine right here.
     
    #2) The bigger problem, is that when I set the 'common' library to read only, the user receives a program failure that I cannot easily handle.  This makes an unfriendly user experience.  The BEST solution, is be able to tell CuteEditor that it can only upload to one of the libraries, and not the other. 
     
    Any other ideas?
     
     
    Filed under: ,
  •  05-08-2011, 11:15 PM 67482 in reply to 67463

    Re: 'read mode' for a gallery?

    Hi briankitt,
     
     a reference solution,
     you can show the upload button in user's personal folder only in your existing solution.
     
    1.  Open the file "CuteSoft_Client/CuteEditor/Dialogs/InsertGallery.apsx"
    2.  Find the method "protected override void OnPreRender(EventArgs args)" , about line 171
    3.  Add the following code to end of the above method 
     
    1. //code to get user's personal gallery folder  
    2.         string userfoler = "/" + "signed in user id";  
    3.         if (Context.Request.QueryString["C_GP"] != null && Context.Request.QueryString["C_GP"].IndexOf(userfoler) >= 0)  
    4.         {  
    5.             myuploadFile.Visible = true;  
    6.         }  
    7.         else  
    8.         {  
    9.             myuploadFile.Visible = false;   
    10.         }  
     Hope it helps.
     
     
    Regards,
    Jeff 
View as RSS news feed in XML