Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
15bb6e1e
Commit
15bb6e1e
authored
Aug 07, 2017
by
http://jneen.net/
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more eagerly bail when the state is prevented
parent
8a167554
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
lib/declarative_policy/runner.rb
lib/declarative_policy/runner.rb
+3
-4
No files found.
lib/declarative_policy/runner.rb
View file @
15bb6e1e
...
@@ -76,6 +76,8 @@ module DeclarativePolicy
...
@@ -76,6 +76,8 @@ module DeclarativePolicy
@state
=
State
.
new
@state
=
State
.
new
steps_by_score
do
|
step
,
score
|
steps_by_score
do
|
step
,
score
|
return
if
!
debug
&&
@state
.
prevented?
passed
=
nil
passed
=
nil
case
step
.
action
case
step
.
action
when
:enable
then
when
:enable
then
...
@@ -93,10 +95,7 @@ module DeclarativePolicy
...
@@ -93,10 +95,7 @@ module DeclarativePolicy
# been prevented.
# been prevented.
unless
@state
.
prevented?
unless
@state
.
prevented?
passed
=
step
.
pass?
passed
=
step
.
pass?
if
passed
@state
.
prevent!
if
passed
@state
.
prevent!
return
unless
debug
end
end
end
debug
<<
inspect_step
(
step
,
score
,
passed
)
if
debug
debug
<<
inspect_step
(
step
,
score
,
passed
)
if
debug
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment