Beispiel #1
0
        public static CommandState GetDesignRightState(CommandState originalState, CommandContext commandContext)
        {
            if (commandContext.Items[0] == null)
            {
                return(originalState);
            }

            // We don't want to enable it if it's disabled
            if (originalState != CommandState.Enabled)
            {
                return(originalState);
            }

            return(DesignAccessRight.IsAllowed(commandContext.Items[0], Context.User)
                ? originalState
                : CommandState.Hidden);
        }
 public override bool GetState()
 {
     return(base.GetState() && DesignAccessRight.IsAllowed(RequestContext.Item, Context.User));
 }