mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-09 14:46:47 +08:00
Merge pull request #8714 from aignatov-bio/ai-sci-12030-add-white-list-for-appendable-repositories
Add whitelist for appendable repositories [SCI-12030]
This commit is contained in:
commit
61c8435a63
2 changed files with 3 additions and 1 deletions
|
@ -48,7 +48,7 @@ class Repository < RepositoryBase
|
|||
}
|
||||
|
||||
scope :appendable_by_user, lambda { |user, teams = user.current_team|
|
||||
readable_ids = with_granted_permissions(user, RepositoryPermissions::ROWS_CREATE).where(team: teams).pluck(:id)
|
||||
readable_ids = with_granted_permissions(user, RepositoryPermissions::ROWS_CREATE).where(type: Extends::REPOSITORY_APPENDABLE_TYPES).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')
|
||||
|
|
|
@ -55,6 +55,8 @@ class Extends
|
|||
RepositoryStockValue: 12,
|
||||
RepositoryStockConsumptionValue: 13 }
|
||||
|
||||
REPOSITORY_APPENDABLE_TYPES = %w(Repository)
|
||||
|
||||
# Data types which can be imported to repository,
|
||||
# name should match record in REPOSITORY_DATA_TYPES
|
||||
REPOSITORY_IMPORTABLE_TYPES = %i(RepositoryTextValue RepositoryListValue RepositoryNumberValue
|
||||
|
|
Loading…
Add table
Reference in a new issue