Copied to clipboard

Flag this post as spam?

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


  • Mário Salgueiro 16 posts 36 karma points
    Oct 20, 2011 @ 15:08
    Mário Salgueiro
    0

    how can i disable Audit Trail from context menu

    Hi, 

    how can i disable Audit Trail from context menu? I already set the permissions to uncheck, but it continues there...

    Any clue about it?

    Regards, 

    Mário

  • Rodion Novoselov 694 posts 859 karma points
    Oct 20, 2011 @ 15:20
    Rodion Novoselov
    0

    Hi. I do remebrer that there's someting strange with this context menu item (it seems to be caused by a clash in character codes with the unused 'unpublish' menu item). I haven't tried it on my own but perhaps directly editing permissions in the database could help.

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Oct 20, 2011 @ 15:27
    Tom Fulton
    0

    You could remove the menu item using some C# via ApplicationBase, or checkout the AttackMonkey Custom Menus package which allows you to specify which menu items you want to show up for each doctype (might be cumbersome to configure at first though).

  • Rodion Novoselov 694 posts 859 karma points
    Oct 20, 2011 @ 15:31
    Rodion Novoselov
    0

    Hmm. I've just tried to turn off this permission for a test user, I can see that the 'Z' letter (audit trail) is gone from the permission string in the database, nevertheless the menu item itself is still safe and sound.

  • Mário Salgueiro 16 posts 36 karma points
    Oct 20, 2011 @ 15:40
    Mário Salgueiro
    0

    yes, it is so strange ... i was doing that my self, the letter Z is there or not if i put the permission or not for audit trail but in context menu of the content tree doesnt happens...

  • Rodion Novoselov 694 posts 859 karma points
    Oct 20, 2011 @ 23:50
    Rodion Novoselov
    1

    To whom it may still interest. I have taken the time to track down this seem-to-be bug and come up with a small and simple fix (to make it work you can just put in inside the App_Code folder):

    using umbraco.BusinessLogic;
    using umbraco.BusinessLogic.Actions;
    using umbraco.cms.presentation.Trees;
    
    public class AuditFix: ApplicationBase
    {
        public AuditFix()
        {
            BaseTree.NodeActionsCreated += delegate(object sender, NodeActionsEventArgs e) {
                var i = e.AllowedActions.FindIndex(a => a.GetType() == typeof(ActionUnPublish));
                if (i != -1)
                {
                    e.AllowedActions[i] = ActionAudit.Instance;
                }
            };
        }
    }
Please Sign in or register to post replies

Write your reply to:

Draft