Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Juan David Gutierrez 4 posts 54 karma points
    Jan 28, 2013 @ 17:31
    Juan David Gutierrez
    0

    Media Section - User permissions

    I am creating a user role with only read permissions in media section, so I extended 3  events.

    1. Media.BeforeSave += new Media.SaveEventHandler(Media_BeforeSave);
        To aviod user saves media nodes.
    2. Media.New += new Media.NewEventHandler(Media_New);
         To avoid user create new node.
    3. BaseTree.BeforeNodeRender += new BaseTree.BeforeNodeRenderEventHandler(this.BaseTree_BeforeNodeRender);
        To delete context menu and avoid all options.

    These functionallity are ok, but when the user try to upload file, he do it.

    So i dont know if exist another method or solution to avoid the user upload a file in media section.

  • Juan David Gutierrez 4 posts 54 karma points
    Jan 28, 2013 @ 17:52
    Juan David Gutierrez
    0

    I remove the save button..using

     public ControlHandler()
            {
                ContentControl.AfterContentControlLoad += new ContentControl.AfterContentControlLoadEventHandler(ContentControl_AfterContentControlLoad);
            }
            protected void ContentControl_AfterContentControlLoad(ContentControl contentControl, ContentControlLoadEventArgs e)
            {
                Page page = HttpContext.Current.Handler as Page;

                if (page != null)
                {
                    StringBuilder sb = new StringBuilder();
                     sb.Append("     $('.editorIcon').hide();");
                    page.RegisterStartupScript("HideSaveAndPublish", sb.ToString());
                }

            }

     i found it in : http://our.umbraco.org/forum/using/ui-questions/5493-Undelete-in-media-section-?p=2

    but i need to display this button because i need to save another fields so, it isnt the solution

     

  • Juan David Gutierrez 4 posts 54 karma points
    Jan 28, 2013 @ 18:21
    Juan David Gutierrez
    100

    So i used the same event to hide the upload button, remove checkbox and label:

                        sb.Append("     $('#body_prop_umbracoFileclear').hide();");
                        sb.Append("     $('#body_prop_umbracoFile').hide();");
                        sb.Append("      $(\"label[for='body_prop_umbracoFileclear']\").hide();");       

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies