Exemple #1
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;
            }
        }