示例#1
0
 /// <summary>
 /// Adds an update trigger for when the block instance properties are updated.
 /// </summary>
 /// <param name="updatePanel">The update panel.</param>
 public void AddAttributeUpdateTrigger(UpdatePanel updatePanel)
 {
     if (CurrentBlock.IsAuthorized("Administrate", CurrentPerson))
     {
         AsyncPostBackTrigger trigger = new AsyncPostBackTrigger();
         trigger.ControlID = string.Format("blck-cnfg-trggr-{0}", CurrentBlock.Id);
         trigger.EventName = "Click";
         updatePanel.Triggers.Add(trigger);
     }
 }
示例#2
0
 /// <summary>
 /// Evaluates if the CurrentPerson is authorized to perform the requested action
 /// </summary>
 /// <param name="action"></param>
 /// <returns></returns>
 public bool IsUserAuthorized(string action)
 {
     return(CurrentBlock.IsAuthorized(action, CurrentPerson));
 }