Exemple #1
0
 /// <summary>
 /// Update the tracking information if the object supplied is not null
 /// </summary>
 /// <param name="trackedObject"></param>
 private void UpdateTrackingInformation(IUpdaterTracking trackedObject)
 {
     if (trackedObject != null)
     {
         trackedObject.UpdatedAt = DateTime.Now;
         trackedObject.UpdatedBy = WinUtils.GetPrincipal().Identity.Name;
     }
 }
Exemple #2
0
        public override sealed void OnSuccess(MethodExecutionArgs args)
        {
            // TODO: Determine way of injecting this from AssemblyInfo.cs
            const string RoleName = "MonarchBSConfiguration";

            if (!WinUtils.IsUserInRole(WinUtils.GetPrincipal(), RoleName))
            {
                MessageBox.Show("No authorisation for " + WinUtils.GetPrincipal().Identity.Name + ", not in role " + RoleName, "Authorisation Failed");
                args.FlowBehavior = FlowBehavior.Return;
                args.ReturnValue  = 1;
            }
            else
            {
                args.FlowBehavior = FlowBehavior.Continue;
                args.ReturnValue  = 0;
            }
        }