Class: Admin::AbuseReports::UpdateService
- Inherits:
-
BaseService
- Object
- BaseService
- Admin::AbuseReports::UpdateService
- Defined in:
- app/services/admin/abuse_reports/update_service.rb
Instance Attribute Summary collapse
-
#abuse_report ⇒ Object
readonly
Returns the value of attribute abuse_report.
-
#current_user ⇒ Object
readonly
Returns the value of attribute current_user.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Attributes inherited from BaseService
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(abuse_report, current_user, params) ⇒ UpdateService
constructor
A new instance of UpdateService.
Methods included from BaseServiceUtility
#deny_visibility_level, #event_service, #log_error, #log_info, #notification_service, #system_hook_service, #todo_service, #visibility_level
Methods included from Gitlab::Allowable
Constructor Details
#initialize(abuse_report, current_user, params) ⇒ UpdateService
Returns a new instance of UpdateService.
8 9 10 11 12 |
# File 'app/services/admin/abuse_reports/update_service.rb', line 8 def initialize(abuse_report, current_user, params) @abuse_report = abuse_report @current_user = current_user @params = params end |
Instance Attribute Details
#abuse_report ⇒ Object (readonly)
Returns the value of attribute abuse_report.
6 7 8 |
# File 'app/services/admin/abuse_reports/update_service.rb', line 6 def abuse_report @abuse_report end |
#current_user ⇒ Object (readonly)
Returns the value of attribute current_user.
6 7 8 |
# File 'app/services/admin/abuse_reports/update_service.rb', line 6 def current_user @current_user end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
6 7 8 |
# File 'app/services/admin/abuse_reports/update_service.rb', line 6 def params @params end |
Instance Method Details
#execute ⇒ Object
14 15 16 17 18 19 20 |
# File 'app/services/admin/abuse_reports/update_service.rb', line 14 def execute return ServiceResponse.error(message: 'Admin is required') unless current_user&.can_admin_all_resources? abuse_report.label_ids = label_ids ServiceResponse.success end |