Commit ce108109 authored by Jarka Košanová's avatar Jarka Košanová

Merge branch 'tle-update-audit-event-service-doc' into 'master'

Fix param type and name order in doc

See merge request gitlab-org/gitlab!25777
parents 07f83752 f1ec3387
...@@ -3,14 +3,13 @@ ...@@ -3,14 +3,13 @@
class AuditEventService class AuditEventService
# Instantiates a new service # Instantiates a new service
# #
# @param author [User] the user who authors the change # @param [User] author the user who authors the change
# @param entity [Object] an instance of either Project/Group/User type. This # @param [User, Project, Group] entity the scope which audit event belongs to
# param is also used to determine at which level the audit events are # This param is also used to determine the visibility of the audit event.
# shown. # - Project: events are visible at Project and Instance level
# - Project: events are visible at Project level # - Group: events are visible at Group and Instance level
# - Group: events are visible at Group level
# - User: events are visible at Instance level # - User: events are visible at Instance level
# @param details [Hash] details to be added to audit event # @param [Hash] details extra data of audit event
# #
# @return [AuditEventService] # @return [AuditEventService]
def initialize(author, entity, details = {}) def initialize(author, entity, details = {})
...@@ -21,7 +20,7 @@ class AuditEventService ...@@ -21,7 +20,7 @@ class AuditEventService
# Builds the @details attribute for authentication # Builds the @details attribute for authentication
# #
# This uses the @author as the target object being changed # This uses the @author as the target object being audited
# #
# @return [AuditEventService] # @return [AuditEventService]
def for_authentication def for_authentication
......
...@@ -7,7 +7,8 @@ module EE ...@@ -7,7 +7,8 @@ module EE
# Builds the @details attribute for member # Builds the @details attribute for member
# #
# @param member [Member] the member whom is changed # @param [Member] member object being audited
#
# @return [AuditEventService] # @return [AuditEventService]
def for_member(member) def for_member(member)
action = @details[:action] action = @details[:action]
...@@ -66,7 +67,7 @@ module EE ...@@ -66,7 +67,7 @@ module EE
# This expects [String] :action of :destroy, :create, :update to be # This expects [String] :action of :destroy, :create, :update to be
# specified in @details attribute # specified in @details attribute
# #
# @param group_link [ProjectGroupLink] the project group link being changed # @param [ProjectGroupLink] group_link object being audited
# #
# @return [AuditEventService] # @return [AuditEventService]
def for_project_group_link(group_link) def for_project_group_link(group_link)
...@@ -129,8 +130,8 @@ module EE ...@@ -129,8 +130,8 @@ module EE
# Creates an event record in DB # Creates an event record in DB
# #
# @return [nil] if audit events is not enabled # @return [SecurityEvent, nil] if record is persisted or nil if audit events
# @return [SecurityEvent] if record is persisted # features are not enabled
def unauth_security_event def unauth_security_event
return unless audit_events_enabled? return unless audit_events_enabled?
...@@ -147,11 +148,11 @@ module EE ...@@ -147,11 +148,11 @@ module EE
# Builds the @details attribute for user # Builds the @details attribute for user
# #
# This uses the [User] @entity as the target object being changed # This uses the [User] @entity as the target object being audited
# #
# @param full_path [String] required if it is different from the User model # @param [String] full_path required if it is different from the User model
# in @entity. This is for backward compatability and this parameter will # in @entity. This is for backward compatability and will be dropped after
# be dropped after all of these incorrect usages are removed. # all of these incorrect usages are removed.
# #
# @return [AuditEventService] # @return [AuditEventService]
def for_user(full_path = @entity.full_path) def for_user(full_path = @entity.full_path)
...@@ -160,7 +161,7 @@ module EE ...@@ -160,7 +161,7 @@ module EE
# Builds the @details attribute for project # Builds the @details attribute for project
# #
# This uses the [Project] @entity as the target object being changed # This uses the [Project] @entity as the target object being audited
# #
# @return [AuditEventService] # @return [AuditEventService]
def for_project def for_project
...@@ -169,7 +170,7 @@ module EE ...@@ -169,7 +170,7 @@ module EE
# Builds the @details attribute for group # Builds the @details attribute for group
# #
# This uses the [Group] @entity as the target object being changed # This uses the [Group] @entity as the target object being audited
# #
# @return [AuditEventService] # @return [AuditEventService]
def for_group def for_group
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment