Пример #1
0
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            if (AceSid != null)
            {
                sb.AppendLineEnv($"{nameof(AceSid)}: {AceSid.ToString()}");
            }

            if (AceType != null)
            {
                sb.AppendLineEnv($"{nameof(AceType)}: {AceType.ToString()}");
            }

            if (AceFlags != null && AceFlags.Any())
            {
                sb.AppendLineEnv($"{nameof(AceFlags)}: {string.Join(", ", AceFlags)}");
            }

            if (Rights != null && Rights.Any())
            {
                sb.AppendLineEnv($"{nameof(Rights)}:");
                for (int i = 0; i < Rights.Length; ++i)
                {
                    sb.AppendIndentEnv(Rights[i]);
                }
            }

            if (ObjectGuid != null)
            {
                sb.AppendLineEnv($"{nameof(ObjectGuid)}: {ObjectGuid.ToString()}");
            }

            if (InheritObjectGuid != null)
            {
                sb.AppendLineEnv($"{nameof(InheritObjectGuid)}: {InheritObjectGuid.ToString()}");
            }

            return(sb.ToString());
        }
Пример #2
0
        public static string GetString(this AceType type)
        {
            switch (type)
            {
            case AceType.AccessAllowedAceType:
                return("A");

            case AceType.AccessDeniedAceType:
                return("D");

            case AceType.SystemAuditAceType:
                return("AU");

            case AceType.SystemAlarmAceType:
                return("AL");

            case AceType.AccessAllowedObjectAceType:
                return("OA");

            case AceType.AccessDeniedObjectAceType:
                return("OD");

            case AceType.SystemAuditObjectAceType:
                return("OU");

            case AceType.SystemAlarmObjectAceType:
                return("OL");

            case AceType.AccessAllowedCallbackAceType:
                return("XA");

            case AceType.AccessDeniedCallbackAceType:
                return("XD");

            case AceType.AccessAllowedCallbackObjectAceType:
                return("ZA");

            case AceType.AccessDeniedCallbackObjectAceType:
                return("ZD");

            case AceType.SystemAuditCallbackAceType:
                return("XU");

            case AceType.SystemAlarmCallbackAceType:
                return("XL");

            case AceType.SystemAuditCallbackObjectAceType:
                return("ZU");

            case AceType.SystemAlarmCallbackObjectAceType:
                return("ZL");

            case AceType.SystemMandatoryLabelAceType:
                return("ML");

            case AceType.SystemResourceAttributeAceType:
                return("RA");

            case AceType.SystemScopedPolicyIDAceType:
                return("SP");

            default:
                return(type.ToString());
            }
        }