Represents a service for handling audit.
Namespace: Umbraco.Cms.Core.Services Assembly: Umbraco.Core.dll Syntaxpublic interface IAuditService : IService
Methods View Source Add(AuditType, Int32, Int32, String, String, String) Declaration
void Add(AuditType type, int userId, int objectId, string entityType, string comment, string parameters = null)
Parameters Type Name Description AuditType type System.Int32 userId System.Int32 objectId System.String entityType System.String comment System.String parameters View Source CleanLogs(Int32) Declaration
void CleanLogs(int maximumAgeOfLogsInMinutes)
Parameters Type Name Description System.Int32 maximumAgeOfLogsInMinutes View Source GetItemsByKeyAsync(Guid, UmbracoObjectTypes, Int32, Int32, Direction, Nullable<DateTimeOffset>, AuditType[])
Returns paged items in the audit trail for a given entity
Declarationvirtual Task<PagedModel<IAuditItem>> GetItemsByKeyAsync(Guid entityKey, UmbracoObjectTypes entityType, int skip, int take, Direction orderDirection = Direction.Descending, DateTimeOffset? sinceDate = null, AuditType[] auditTypeFilter = null)
Parameters Type Name Description Guid entityKey
The key of the entity
UmbracoObjectTypes entityTypeThe entity type
System.Int32 skipThe amount of audit trail entries to skip
System.Int32 takeThe amount of audit trail entries to take
Direction orderDirectionBy default this will always be ordered descending (newest first)
System.Nullable<DateTimeOffset> sinceDateIf populated, will only return entries after this time.
AuditType[] auditTypeFilterSince we currently do not have enum support with our expression parser, we cannot query on AuditType in the query or the custom filter so we need to do that here
Returns View Source GetLogs(Int32) DeclarationIEnumerable<IAuditItem> GetLogs(int objectId)
Parameters Type Name Description System.Int32 objectId Returns View Source GetLogs(AuditType, Nullable<DateTime>) Declaration
IEnumerable<IAuditItem> GetLogs(AuditType type, DateTime? sinceDate = null)
Parameters Type Name Description AuditType type System.Nullable<DateTime> sinceDate Returns View Source GetPagedItemsByEntity(Int32, Int64, Int32, out Int64, Direction, AuditType[], IQuery<IAuditItem>)
Returns paged items in the audit trail for a given entity
DeclarationIEnumerable<IAuditItem> GetPagedItemsByEntity(int entityId, long pageIndex, int pageSize, out long totalRecords, Direction orderDirection = Direction.Descending, AuditType[] auditTypeFilter = null, IQuery<IAuditItem> customFilter = null)
Parameters Type Name Description System.Int32 entityId System.Int64 pageIndex System.Int32 pageSize System.Int64 totalRecords Direction orderDirection
By default this will always be ordered descending (newest first)
AuditType[] auditTypeFilterSince we currently do not have enum support with our expression parser, we cannot query on AuditType in the query or the custom filter so we need to do that here
IQuery<IAuditItem> customFilterOptional filter to be applied
Returns View Source GetPagedItemsByUser(Int32, Int64, Int32, out Int64, Direction, AuditType[], IQuery<IAuditItem>)Returns paged items in the audit trail for a given user
DeclarationIEnumerable<IAuditItem> GetPagedItemsByUser(int userId, long pageIndex, int pageSize, out long totalRecords, Direction orderDirection = Direction.Descending, AuditType[] auditTypeFilter = null, IQuery<IAuditItem> customFilter = null)
Parameters Type Name Description System.Int32 userId System.Int64 pageIndex System.Int32 pageSize System.Int64 totalRecords Direction orderDirection
By default this will always be ordered descending (newest first)
AuditType[] auditTypeFilterSince we currently do not have enum support with our expression parser, we cannot query on AuditType in the query or the custom filter so we need to do that here
IQuery<IAuditItem> customFilterOptional filter to be applied
Returns View Source GetPagedItemsByUserAsync(Guid, Int32, Int32, Direction, AuditType[], Nullable<DateTime>)Returns paged items in the audit trail for a given user
Declarationvirtual Task<PagedModel<IAuditItem>> GetPagedItemsByUserAsync(Guid userKey, int skip, int take, Direction orderDirection = Direction.Descending, AuditType[] auditTypeFilter = null, DateTime? sinceDate = null)
Parameters Type Name Description Guid userKey System.Int32 skip System.Int32 take Direction orderDirection
By default this will always be ordered descending (newest first)
AuditType[] auditTypeFilterSince we currently do not have enum support with our expression parser, we cannot query on AuditType in the query or the custom filter so we need to do that here
System.Nullable<DateTime> sinceDate Returns View Source GetUserLogs(Int32, AuditType, Nullable<DateTime>) DeclarationIEnumerable<IAuditItem> GetUserLogs(int userId, AuditType type, DateTime? sinceDate = null)
Parameters Type Name Description System.Int32 userId AuditType type System.Nullable<DateTime> sinceDate Returns View Source Write(Int32, String, String, DateTime, Int32, String, String, String)
Writes an audit entry for an audited event.
DeclarationIAuditEntry Write(int performingUserId, string perfomingDetails, string performingIp, DateTime eventDateUtc, int affectedUserId, string affectedDetails, string eventType, string eventDetails)
Parameters Type Name Description System.Int32 performingUserId
The identifier of the user triggering the audited event.
System.String perfomingDetailsFree-form details about the user triggering the audited event.
System.String performingIpThe IP address or the request triggering the audited event.
DateTime eventDateUtcThe date and time of the audited event.
System.Int32 affectedUserIdThe identifier of the user affected by the audited event.
System.String affectedDetailsFree-form details about the entity affected by the audited event.
System.String eventTypeThe type of the audited event - must contain only alphanumeric chars and hyphens with forward slashes separating categories. The eventType will generally be formatted like: {application}/{entity-type}/{category}/{sub-category} Example: umbraco/user/sign-in/failed
System.String eventDetailsFree-form details about the audited event.
ReturnsRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4