You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.6 KiB
44 lines
1.6 KiB
3 years ago
|
using Volo.Abp.AuditLogging.Localization;
|
||
|
using Volo.Abp.Features;
|
||
|
using Volo.Abp.Localization;
|
||
|
using Volo.Abp.Validation.StringValues;
|
||
|
|
||
|
namespace Sanhe.Abp.Auditing.Features
|
||
|
{
|
||
|
public class AuditingFeatureDefinitionProvider : FeatureDefinitionProvider
|
||
|
{
|
||
|
public override void Define(IFeatureDefinitionContext context)
|
||
|
{
|
||
|
var auditingGroup = context.AddGroup(
|
||
|
name: AuditingFeatureNames.GroupName,
|
||
|
displayName: L("Features:Auditing"));
|
||
|
|
||
|
var loggingFeature = auditingGroup.AddFeature(
|
||
|
name: AuditingFeatureNames.Logging.Default,
|
||
|
displayName: L("Features:Auditing"),
|
||
|
description: L("Features:Auditing")
|
||
|
);
|
||
|
|
||
|
loggingFeature.CreateChild(
|
||
|
name: AuditingFeatureNames.Logging.AuditLog,
|
||
|
defaultValue: true.ToString(),
|
||
|
displayName: L("Features:DisplayName:AuditLog"),
|
||
|
description: L("Features:Description:AuditLog"),
|
||
|
valueType: new ToggleStringValueType(new BooleanValueValidator())
|
||
|
);
|
||
|
loggingFeature.CreateChild(
|
||
|
name: AuditingFeatureNames.Logging.SecurityLog,
|
||
|
defaultValue: true.ToString(),
|
||
|
displayName: L("Features:DisplayName:SecurityLog"),
|
||
|
description: L("Features:Description:SecurityLog"),
|
||
|
valueType: new ToggleStringValueType(new BooleanValueValidator())
|
||
|
);
|
||
|
}
|
||
|
|
||
|
protected LocalizableString L(string name)
|
||
|
{
|
||
|
return LocalizableString.Create<AuditLoggingResource>(name);
|
||
|
}
|
||
|
}
|
||
|
}
|