Skip to content

Commit e896763

Browse files
authored
fix(permissions): use correct collection name for model under module (#624)
1 parent 22c12d3 commit e896763

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/services/forest_liana/ability/permission.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ def is_smart_action_authorized?(user, collection, parameters, endpoint, http_met
3535
user_data = get_user_data(user['id'])
3636
collections_data = get_collections_permissions_data
3737
begin
38-
action = find_action_from_endpoint(collection.name, endpoint, http_method).name
38+
action = find_action_from_endpoint(ForestLiana.name_for(collection), endpoint, http_method).name
3939

40-
smart_action_approval = SmartActionChecker.new(parameters, collection, collections_data[collection.name][:actions][action], user_data)
40+
smart_action_approval = SmartActionChecker.new(parameters, collection, collections_data[ForestLiana.name_for(collection)][:actions][action], user_data)
4141
smart_action_approval.can_execute?
4242
rescue
4343
raise ForestLiana::Errors::ExpectedError.new(409, :conflict, "The collection #{collection} doesn't exist", 'collection not found')

0 commit comments

Comments
 (0)