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.
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.
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
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();");
is working on a reply...