mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-27 23:45:52 +08:00
Merge pull request #8337 from aignatov-bio/ai-sci-11658-fix-shared-inventories-assigned-items
Fix shared inventories in assigning items modal [SCI-11658]
This commit is contained in:
commit
8270b101b0
1 changed files with 2 additions and 2 deletions
|
@ -51,7 +51,7 @@ class Repository < RepositoryBase
|
|||
}
|
||||
|
||||
scope :appendable_by_user, lambda { |user, teams = user.current_team|
|
||||
readable_ids = active.with_granted_permissions(user, RepositoryPermissions::ROWS_CREATE).where(team: teams).pluck(:id)
|
||||
readable_ids = with_granted_permissions(user, RepositoryPermissions::ROWS_CREATE).where(team: teams).pluck(:id)
|
||||
shared_with_team_ids = joins(:team_shared_objects, :team).where(team_shared_objects: { team: teams, permission_level: :shared_write }).pluck(:id)
|
||||
globally_shared_ids =
|
||||
if column_names.include?('permission_level')
|
||||
|
@ -66,7 +66,7 @@ class Repository < RepositoryBase
|
|||
none.pluck(:id)
|
||||
end
|
||||
|
||||
where(id: (readable_ids + shared_with_team_ids + globally_shared_ids).uniq)
|
||||
active.where(id: (readable_ids + shared_with_team_ids + globally_shared_ids).uniq)
|
||||
}
|
||||
|
||||
def self.within_global_limits?
|
||||
|
|
Loading…
Add table
Reference in a new issue