Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
RDMS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
researchdata
RDMS
Commits
f0db42e0
Commit
f0db42e0
authored
3 weeks ago
by
Gyan Gupta
Browse files
Options
Downloads
Patches
Plain Diff
fixes ability for review submission page
parent
0bd11db0
No related branches found
No related tags found
2 merge requests
!385
Fixes ability for review submission page
,
!346
Draft: Hyrax 5 - Upgrade hyrax to v5
Pipeline
#20712
failed
3 weeks ago
Stage: build
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hyrax/app/models/ability.rb
+15
-0
15 additions, 0 deletions
hyrax/app/models/ability.rb
with
15 additions
and
0 deletions
hyrax/app/models/ability.rb
+
15
−
0
View file @
f0db42e0
...
...
@@ -62,4 +62,19 @@ class Ability
def
can_export_works?
can_create_any_work?
end
def
can_review_submissions?
# Short-circuit logic for admins, who should have the ability
# to review submissions whether or not they are explicitly
# granted the approving role in any workflows
return
true
if
admin?
# Are there any workflows where this user has the "approving" responsibility
approving_roles
=
Sipity
::
Role
.
where
(
name:
[
'approving_crc_manager'
,
'approving_group_manager'
,
'approving_publication_manager'
])
return
false
unless
approving_roles
Hyrax
::
Workflow
::
PermissionQuery
.
scope_processing_agents_for
(
user:
current_user
).
any?
do
|
agent
|
agent
.
workflow_responsibilities
.
joins
(
:workflow_role
).
where
(
'sipity_workflow_roles.role_id'
=>
approving_roles
.
pluck
(
:id
)).
any?
end
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment