Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nexus_cqrs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Public
nexus_cqrs
Commits
7b936bff
Commit
7b936bff
authored
1 year ago
by
Dean Lovett
Browse files
Options
Downloads
Patches
Plain Diff
chore: added improved message
parent
5acf1b8b
No related branches found
No related tags found
No related merge requests found
Pipeline
#49249
passed
1 year ago
Stage: release
Stage: test
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/nexus_cqrs/auth/auth.rb
+4
-1
4 additions, 1 deletion
lib/nexus_cqrs/auth/auth.rb
with
4 additions
and
1 deletion
lib/nexus_cqrs/auth/auth.rb
+
4
−
1
View file @
7b936bff
...
...
@@ -24,7 +24,10 @@ module NexusCqrs
global_permissions
=
message
.
metadata
[
:global_permissions
]
# Raise issue if policy class doesn't exist
raise
Pundit
::
NotAuthorizedError
,
query:
query
,
record:
record
if
policy_class
.
nil?
raise
Pundit
::
NotAuthorizedError
,
query:
query
,
record:
record
,
message:
"There is no policy class available for
#{
record
.
class
}
"
if
policy_class
.
nil?
# Instantiate new policy class, with context
policy
=
policy_class
.
new
(
UserContext
.
new
(
user
,
global_permissions
),
record
)
...
...
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