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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
b6aa0b98
Commit
b6aa0b98
authored
Jun 30, 2017
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix conflicts in policies
parent
571e9fdd
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
55 deletions
+0
-55
app/policies/base_policy.rb
app/policies/base_policy.rb
+0
-7
app/policies/group_policy.rb
app/policies/group_policy.rb
+0
-14
app/policies/project_policy.rb
app/policies/project_policy.rb
+0
-31
app/policies/project_snippet_policy.rb
app/policies/project_snippet_policy.rb
+0
-3
No files found.
app/policies/base_policy.rb
View file @
b6aa0b98
<<<<<<<
HEAD
require
'declarative_policy'
=======
require_dependency
'declarative_policy'
>>>>>>>
ce
/
master
class
BasePolicy
<
DeclarativePolicy
::
Base
desc
"User is an instance admin"
...
...
@@ -14,7 +10,6 @@ class BasePolicy < DeclarativePolicy::Base
with_options
scope: :user
,
score:
0
condition
(
:can_create_group
)
{
@user
&
.
can_create_group
}
<<<<<<<
HEAD
# EE Extensions
with_scope
:user
...
...
@@ -25,6 +20,4 @@ class BasePolicy < DeclarativePolicy::Base
with_scope
:global
condition
(
:license_block
)
{
License
.
block_changes?
}
=======
>>>>>>>
ce
/
master
end
app/policies/group_policy.rb
View file @
b6aa0b98
class
GroupPolicy
<
BasePolicy
<<<<<<<
HEAD
prepend
EE
::
GroupPolicy
=======
>>>>>>>
ce
/
master
desc
"Group is public"
with_options
scope: :subject
,
score:
0
condition
(
:public_group
)
{
@subject
.
public?
}
with_score
0
condition
(
:logged_in_viewable
)
{
@user
&&
@subject
.
internal?
&&
!
@user
.
external?
}
<<<<<<<
HEAD
condition
(
:has_access
)
{
access_level
!=
GroupMember
::
NO_ACCESS
}
...
...
@@ -19,16 +15,6 @@ class GroupPolicy < BasePolicy
condition
(
:master
)
{
access_level
>=
GroupMember
::
MASTER
}
condition
(
:reporter
)
{
access_level
>=
GroupMember
::
REPORTER
}
=======
condition
(
:has_access
)
{
access_level
!=
GroupMember
::
NO_ACCESS
}
condition
(
:guest
)
{
access_level
>=
GroupMember
::
GUEST
}
condition
(
:owner
)
{
access_level
>=
GroupMember
::
OWNER
}
condition
(
:master
)
{
access_level
>=
GroupMember
::
MASTER
}
condition
(
:reporter
)
{
access_level
>=
GroupMember
::
REPORTER
}
>>>>>>>
ce
/
master
condition
(
:has_projects
)
do
GroupProjectsFinder
.
new
(
group:
@subject
,
current_user:
@user
).
execute
.
any?
end
...
...
app/policies/project_policy.rb
View file @
b6aa0b98
class
ProjectPolicy
<
BasePolicy
<<<<<<<
HEAD
prepend
EE
::
ProjectPolicy
def
self
.
create_read_update_admin
(
name
)
...
...
@@ -30,36 +29,6 @@ class ProjectPolicy < BasePolicy
desc
"User has reporter access"
condition
(
:reporter
)
{
team_access_level
>=
Gitlab
::
Access
::
REPORTER
}
=======
def
self
.
create_read_update_admin
(
name
)
[
:"create_
#{
name
}
"
,
:"read_
#{
name
}
"
,
:"update_
#{
name
}
"
,
:"admin_
#{
name
}
"
]
end
desc
"User is a project owner"
condition
:owner
do
@user
&&
project
.
owner
==
@user
||
(
project
.
group
&&
project
.
group
.
has_owner?
(
@user
))
end
desc
"Project has public builds enabled"
condition
(
:public_builds
,
scope: :subject
)
{
project
.
public_builds?
}
# For guest access we use #is_team_member? so we can use
# project.members, which gets cached in subject scope.
# This is safe because team_access_level is guaranteed
# by ProjectAuthorization's validation to be at minimum
# GUEST
desc
"User has guest access"
condition
(
:guest
)
{
is_team_member?
}
desc
"User has reporter access"
condition
(
:reporter
)
{
team_access_level
>=
Gitlab
::
Access
::
REPORTER
}
>>>>>>>
ce
/
master
desc
"User has developer access"
condition
(
:developer
)
{
team_access_level
>=
Gitlab
::
Access
::
DEVELOPER
}
...
...
app/policies/project_snippet_policy.rb
View file @
b6aa0b98
...
...
@@ -27,10 +27,7 @@ class ProjectSnippetPolicy < BasePolicy
all?
(
private_snippet
|
(
internal
&
external_user
),
~
project
.
guest
,
~
admin
,
<<<<<<<
HEAD
~
auditor
,
=======
>>>>>>>
ce
/
master
~
is_author
)
end
.
prevent
:read_project_snippet
...
...
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