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
iv
gitlab-ce
Commits
729088a7
Commit
729088a7
authored
Jan 16, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Owner can enable public mode for project
parent
a39c9106
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
4 deletions
+19
-4
app/contexts/project_update_context.rb
app/contexts/project_update_context.rb
+1
-0
app/models/ability.rb
app/models/ability.rb
+1
-0
app/models/project.rb
app/models/project.rb
+2
-2
app/views/admin/projects/index.html.haml
app/views/admin/projects/index.html.haml
+1
-1
app/views/projects/_form.html.haml
app/views/projects/_form.html.haml
+13
-0
app/views/public/projects/index.html.haml
app/views/public/projects/index.html.haml
+1
-1
No files found.
app/contexts/project_update_context.rb
View file @
729088a7
class
ProjectUpdateContext
<
BaseContext
class
ProjectUpdateContext
<
BaseContext
def
execute
(
role
=
:default
)
def
execute
(
role
=
:default
)
namespace_id
=
params
[
:project
].
delete
(
:namespace_id
)
namespace_id
=
params
[
:project
].
delete
(
:namespace_id
)
params
[
:project
].
delete
(
:public
)
unless
can?
(
current_user
,
:change_public_mode
,
project
)
allowed_transfer
=
can?
(
current_user
,
:change_namespace
,
project
)
||
role
==
:admin
allowed_transfer
=
can?
(
current_user
,
:change_namespace
,
project
)
||
role
==
:admin
...
...
app/models/ability.rb
View file @
729088a7
...
@@ -90,6 +90,7 @@ class Ability
...
@@ -90,6 +90,7 @@ class Ability
def
project_admin_rules
def
project_admin_rules
project_master_rules
+
[
project_master_rules
+
[
:change_namespace
,
:change_namespace
,
:change_public_mode
,
:rename_project
,
:rename_project
,
:remove_project
:remove_project
]
]
...
...
app/models/project.rb
View file @
729088a7
...
@@ -26,9 +26,9 @@ class Project < ActiveRecord::Base
...
@@ -26,9 +26,9 @@ class Project < ActiveRecord::Base
class
TransferError
<
StandardError
;
end
class
TransferError
<
StandardError
;
end
attr_accessible
:name
,
:path
,
:description
,
:default_branch
,
:issues_enabled
,
attr_accessible
:name
,
:path
,
:description
,
:default_branch
,
:issues_enabled
,
:wall_enabled
,
:merge_requests_enabled
,
:wiki_enabled
,
as:
[
:default
,
:admin
]
:wall_enabled
,
:merge_requests_enabled
,
:wiki_enabled
,
:public
,
as:
[
:default
,
:admin
]
attr_accessible
:namespace_id
,
:creator_id
,
:public
,
as: :admin
attr_accessible
:namespace_id
,
:creator_id
,
as: :admin
attr_accessor
:error_code
attr_accessor
:error_code
...
...
app/views/admin/projects/index.html.haml
View file @
729088a7
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
-
@projects
.
each
do
|
project
|
-
@projects
.
each
do
|
project
|
%li
%li
-
if
project
.
public
-
if
project
.
public
%i
.icon-
unlock.cred
%i
.icon-
share
-
else
-
else
%i
.icon-lock.cgreen
%i
.icon-lock.cgreen
=
link_to
project
.
name_with_namespace
,
[
:admin
,
project
]
=
link_to
project
.
name_with_namespace
,
[
:admin
,
project
]
...
...
app/views/projects/_form.html.haml
View file @
729088a7
...
@@ -50,6 +50,19 @@
...
@@ -50,6 +50,19 @@
=
f
.
check_box
:wiki_enabled
=
f
.
check_box
:wiki_enabled
%span
.descr
Pages for project documentation
%span
.descr
Pages for project documentation
-
if
can?
current_user
,
:change_public_mode
,
@project
%fieldset
.features
%legend
%i
.icon-share
Public mode:
.control-group
=
f
.
label
:public
,
class:
'control-label'
do
%span
Public http clone
.controls
=
f
.
check_box
:public
%span
.descr
If checked this project will be available for clone without any authentification. Also it will appears on
#{
link_to
"Public page"
,
public_root_path
}
-
if
can?
current_user
,
:change_namespace
,
@project
-
if
can?
current_user
,
:change_namespace
,
@project
%fieldset
.features
%fieldset
.features
...
...
app/views/public/projects/index.html.haml
View file @
729088a7
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
-
@projects
.
each
do
|
project
|
-
@projects
.
each
do
|
project
|
%li
.clearfix
%li
.clearfix
%h5
%h5
%i
.icon-s
tar.cgreen
%i
.icon-s
hare
=
project
.
name_with_namespace
=
project
.
name_with_namespace
.right
.right
%span
.monospace.tiny
%span
.monospace.tiny
...
...
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