-
Notifications
You must be signed in to change notification settings - Fork 1
staging into main #186
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
staging into main #186
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,19 +36,16 @@ def show? | |
| class Scope < Scope | ||
| def resolve | ||
| base_scope = scope.where(deleted: false) # Only show non-deleted entries by default | ||
| admin_role_ids = Role.where(kind: ['Collection Administrator', 'Collection Manager']).pluck(:id) | ||
| admin_container_ids = user.present? ? user.assignments.where(role_id: admin_role_ids).pluck(:container_id).uniq : [] | ||
|
Comment on lines
+39
to
+40
|
||
|
|
||
| if user.nil? | ||
| scope.none | ||
| elsif user.axis_mundi? | ||
| # Axis mundi can see all entries | ||
| base_scope | ||
| elsif user.administrator? || user.manager? | ||
| # Collection administrators and managers can see entries from their containers | ||
| admin_role_ids = Role.where(kind: ['Collection Administrator', 'Collection Manager']).pluck(:id) | ||
| admin_container_ids = user.assignments | ||
| .where(role_id: admin_role_ids) | ||
| .pluck(:container_id) | ||
|
|
||
| elsif admin_container_ids.any? | ||
| # Collection administrators and managers (by container assignment) can see entries from their containers | ||
| base_scope.joins(contest_instance: { contest_description: :container }) | ||
| .where(containers: { id: admin_container_ids }) | ||
|
Comment on lines
+47
to
50
|
||
| elsif user.judge? | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -21,6 +21,43 @@ | |||||
| end | ||||||
| end | ||||||
|
|
||||||
| context "when user is a Container Administrator for the entry's container" do | ||||||
|
||||||
| context "when user is a Container Administrator for the entry's container" do | |
| context "when user is a Collection Administrator for the entry's container" do |
Uh oh!
There was an error while loading. Please reload this page.