mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-06 05:04:35 +08:00
Merge pull request #8804 from andrej-scinote/aj_SCI_12254
Fix list selected repositories for list [SCI-12254]
This commit is contained in:
commit
f79be1a792
1 changed files with 5 additions and 1 deletions
|
@ -44,7 +44,11 @@ class RepositoriesController < ApplicationController
|
|||
end
|
||||
|
||||
def list
|
||||
repositories = params[:manageable] == 'true' ? Repository.managable_by_user(current_user, current_team) : Repository.readable_by_user(current_user, current_team)
|
||||
repositories = if params[:manageable] == 'true'
|
||||
Repository.with_granted_permissions(current_user, RepositoryPermissions::ROWS_UPDATE, current_team)
|
||||
else
|
||||
Repository.readable_by_user(current_user, current_team)
|
||||
end
|
||||
results = repositories.select(:id, :name, 'LOWER(repositories.name)')
|
||||
results = results.name_like(params[:query]) if params[:query].present?
|
||||
results = results.joins(:repository_rows).distinct if params[:non_empty].present?
|
||||
|
|
Loading…
Add table
Reference in a new issue