mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-21 06:51:25 +08:00
Merge pull request #4727 from okriuchykhin/ok_SCI_7422_v2
Fix viewer permissions for inventories [SCI-7422]
This commit is contained in:
commit
5aaeee4b16
2 changed files with 3 additions and 3 deletions
|
@ -170,8 +170,8 @@ class Repository < RepositoryBase
|
|||
team_shared_objects.where(team: team, permission_level: :shared_write).any?
|
||||
end
|
||||
|
||||
def self.viewable_by_user(user, teams)
|
||||
accessible_by_teams(teams).with_granted_permissions(user, RepositoryPermissions::READ)
|
||||
def self.viewable_by_user(_user, teams)
|
||||
accessible_by_teams(teams)
|
||||
end
|
||||
|
||||
def self.name_like(query)
|
||||
|
|
|
@ -6,7 +6,7 @@ Canaid::Permissions.register_for(RepositoryBase) do
|
|||
if repository.is_a?(RepositorySnapshot)
|
||||
can_read_my_module?(user, repository.my_module)
|
||||
else
|
||||
repository.permission_granted?(user, RepositoryPermissions::READ)
|
||||
user.teams.include?(repository.team) || repository.shared_with?(user.current_team)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue