Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f1ec3387
Commit
f1ec3387
authored
Feb 22, 2020
by
Tan Le
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix param type and name order
The correct placement is type following by name as per Yardoc format.
parent
eb3770c9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
18 deletions
+18
-18
app/services/audit_event_service.rb
app/services/audit_event_service.rb
+7
-8
ee/app/services/ee/audit_event_service.rb
ee/app/services/ee/audit_event_service.rb
+11
-10
No files found.
app/services/audit_event_service.rb
View file @
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
chang
ed
# This uses the @author as the target object being
audit
ed
#
#
# @return [AuditEventService]
# @return [AuditEventService]
def
for_authentication
def
for_authentication
...
...
ee/app/services/ee/audit_event_service.rb
View file @
f1ec3387
...
@@ -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 chang
ed
# @param
[ProjectGroupLink] group_link object being audit
ed
#
#
# @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 persist
ed
#
features are not enabl
ed
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
chang
ed
# This uses the [User] @entity as the target object being
audit
ed
#
#
# @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
chang
ed
# This uses the [Project] @entity as the target object being
audit
ed
#
#
# @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
chang
ed
# This uses the [Group] @entity as the target object being
audit
ed
#
#
# @return [AuditEventService]
# @return [AuditEventService]
def
for_group
def
for_group
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment