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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
3cce570c
Commit
3cce570c
authored
Jun 06, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow forking of public projects by authenticated users. Fixes #4152
parent
20ce3980
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
1 deletion
+22
-1
app/models/ability.rb
app/models/ability.rb
+22
-1
No files found.
app/models/ability.rb
View file @
3cce570c
...
@@ -38,10 +38,14 @@ class Ability
...
@@ -38,10 +38,14 @@ class Ability
elsif
team
.
reporters
.
include?
(
user
)
elsif
team
.
reporters
.
include?
(
user
)
rules
<<
project_report_rules
rules
<<
project_report_rules
elsif
team
.
guests
.
include?
(
user
)
or
project
.
public?
elsif
team
.
guests
.
include?
(
user
)
rules
<<
project_guest_rules
rules
<<
project_guest_rules
end
end
if
project
.
public?
rules
<<
public_project_rules
end
if
project
.
owner
==
user
||
user
.
admin?
if
project
.
owner
==
user
||
user
.
admin?
rules
<<
project_admin_rules
rules
<<
project_admin_rules
end
end
...
@@ -49,6 +53,23 @@ class Ability
...
@@ -49,6 +53,23 @@ class Ability
rules
.
flatten
rules
.
flatten
end
end
def
public_project_rules
[
:download_code
,
:fork_project
,
:read_project
,
:read_wiki
,
:read_issue
,
:read_milestone
,
:read_project_snippet
,
:read_team_member
,
:read_merge_request
,
:read_note
,
:write_issue
,
:write_note
]
end
def
project_guest_rules
def
project_guest_rules
[
[
:read_project
,
:read_project
,
...
...
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