-
Notifications
You must be signed in to change notification settings - Fork 107
Fix permissions check in repository api [SCI-12136] #8661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: features/user-groups
Are you sure you want to change the base?
Fix permissions check in repository api [SCI-12136] #8661
Conversation
@@ -61,7 +62,7 @@ def update | |||
end | |||
|
|||
def destroy | |||
@inventory_item = @task.repository_rows.find(params.require(:id)) | |||
@inventory_item = @repository_rows.find_by(id: params.require(:id)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why it was changed to find_by?
@@ -79,6 +80,10 @@ def load_my_module_repository_row | |||
.find_by(my_module: @task) | |||
end | |||
|
|||
def load_repository_rows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change it to load_repository_row and load a single row here
9e3659f
to
9931131
Compare
9931131
to
db24ebd
Compare
raise PermissionError.new(Repository, :read) unless @inventory_item && can_read_repository?(@inventory_item.repository) | ||
|
||
@task.my_module_repository_rows.find_by(repository_row: @inventory_item).destroy! | ||
@task.my_module_repository_rows.find_by(repository_row: @repository_row).destroy! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to .find
Jira ticket: SCI-12136
What was done
Fix permissions check in repository api