Exemple #1
0
        /// <summary>
        /// todoComment
        /// </summary>
        public static string MsgSecurityExceptionString(ESecurityPartnerAccessDeniedException AException)
        {
            string StrMessageAccessDenied = Catalog.GetString("Access to Partner {0}denied.");
            string SpecificMessageText;
            TPartnerAccessLevelEnum AccessLevel;

            AccessLevel = (TPartnerAccessLevelEnum)Enum.Parse(
                typeof(TPartnerAccessLevelEnum),
                Enum.GetName(typeof(TPartnerAccessLevelEnum), AException.AccessLevel));

            SpecificMessageText = String.Format(StrMessageAccessDenied,
                                                Environment.NewLine + "    " + AException.PartnerShortName +
                                                " [" + AException.PartnerKey.ToString() + "]" + Environment.NewLine);

            switch (AccessLevel)
            {
            case TPartnerAccessLevelEnum.palRestrictedToUser:
            case TPartnerAccessLevelEnum.palRestrictedToGroup:
                SpecificMessageText = SpecificMessageText + Environment.NewLine + Environment.NewLine +
                                      Catalog.GetString("Reason: Partner is a Private Partner of another user.");
                break;

            case TPartnerAccessLevelEnum.palRestrictedByFoundationOwnership:
                SpecificMessageText = SpecificMessageText + Environment.NewLine + Environment.NewLine +
                                      Catalog.GetString("Reason: You must be the owner of a foundation in order to edit it.");
                break;
            }

            return(SpecificMessageText);
        }
Exemple #2
0
 /// <summary>
 /// todoComment
 /// </summary>
 /// <param name="AException"></param>
 public static void MsgSecurityException(ESecurityPartnerAccessDeniedException AException)
 {
     MessageBox.Show(MsgSecurityExceptionString(AException), Catalog.GetString(
                         "Security Violation"), MessageBoxButtons.OK,
                     MessageBoxIcon.Information);
 }