Class: ActivityPermissionEngine::AllowActivity

Inherits:
Object
  • Object
show all
Defined in:
lib/activity_permission_engine/allow_activity.rb

Defined Under Namespace

Classes: Request, Response

Instance Method Summary collapse

Constructor Details

#initialize(request, activities_registry = ActivityPermissionEngine.configuration.activity_permissions_registry) ⇒ AllowActivity

Returns a new instance of AllowActivity.



3
4
5
6
# File 'lib/activity_permission_engine/allow_activity.rb', line 3

def initialize(request, activities_registry = ActivityPermissionEngine.configuration.activity_permissions_registry)
  @request = request
  @activities_registry = activities_registry
end

Instance Method Details

#callObject



9
10
11
# File 'lib/activity_permission_engine/allow_activity.rb', line 9

def call
  Response.new(activities_registry.add_role(request.activity_ref, request.role_ref))
end