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
f8ff70c0
Commit
f8ff70c0
authored
Feb 19, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix pages abilities
parent
b597aab0
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
20 additions
and
11 deletions
+20
-11
app/controllers/projects/pages_controller.rb
app/controllers/projects/pages_controller.rb
+2
-1
app/models/ability.rb
app/models/ability.rb
+4
-2
app/views/projects/pages/_destroy.haml
app/views/projects/pages/_destroy.haml
+2
-0
app/views/projects/pages/_list.html.haml
app/views/projects/pages/_list.html.haml
+1
-1
app/views/projects/pages/_no_domains.html.haml
app/views/projects/pages/_no_domains.html.haml
+7
-6
app/views/projects/pages/show.html.haml
app/views/projects/pages/show.html.haml
+1
-1
doc/permissions/permissions.md
doc/permissions/permissions.md
+3
-0
No files found.
app/controllers/projects/pages_controller.rb
View file @
f8ff70c0
class
Projects::PagesController
<
Projects
::
ApplicationController
class
Projects::PagesController
<
Projects
::
ApplicationController
layout
'project_settings'
layout
'project_settings'
before_action
:authorize_update_pages!
before_action
:authorize_read_pages!
,
only:
[
:show
]
before_action
:authorize_update_pages!
,
except:
[
:show
]
def
show
def
show
@domains
=
@project
.
pages_domains
.
order
(
:domain
)
@domains
=
@project
.
pages_domains
.
order
(
:domain
)
...
...
app/models/ability.rb
View file @
f8ff70c0
...
@@ -224,9 +224,11 @@ class Ability
...
@@ -224,9 +224,11 @@ class Ability
def
project_master_rules
def
project_master_rules
@project_master_rules
||=
project_dev_rules
+
[
@project_master_rules
||=
project_dev_rules
+
[
:read_pages
,
:push_code_to_protected_branches
,
:push_code_to_protected_branches
,
:update_project_snippet
,
:update_project_snippet
,
:update_merge_request
,
:update_merge_request
,
:update_pages
,
:admin_milestone
,
:admin_milestone
,
:admin_project_snippet
,
:admin_project_snippet
,
:admin_project_member
,
:admin_project_member
,
...
@@ -235,7 +237,8 @@ class Ability
...
@@ -235,7 +237,8 @@ class Ability
:admin_wiki
,
:admin_wiki
,
:admin_project
,
:admin_project
,
:admin_commit_status
,
:admin_commit_status
,
:admin_build
:admin_build
,
:admin_pages
,
]
]
end
end
...
@@ -245,7 +248,6 @@ class Ability
...
@@ -245,7 +248,6 @@ class Ability
:change_visibility_level
,
:change_visibility_level
,
:rename_project
,
:rename_project
,
:remove_project
,
:remove_project
,
:update_pages
,
:remove_pages
,
:remove_pages
,
:archive_project
,
:archive_project
,
:remove_fork_project
:remove_fork_project
...
...
app/views/projects/pages/_destroy.haml
View file @
f8ff70c0
...
@@ -7,3 +7,5 @@
...
@@ -7,3 +7,5 @@
Removing the pages will prevent from exposing them to outside world.
Removing the pages will prevent from exposing them to outside world.
.form-actions
.form-actions
=
link_to
'Remove pages'
,
namespace_project_pages_path
(
@project
.
namespace
,
@project
),
data:
{
confirm:
'Are you sure?'
},
method: :delete
,
class:
"btn btn-remove"
=
link_to
'Remove pages'
,
namespace_project_pages_path
(
@project
.
namespace
,
@project
),
data:
{
confirm:
'Are you sure?'
},
method: :delete
,
class:
"btn btn-remove"
-
else
.nothing-here-block
Only the project owner can remove pages
app/views/projects/pages/_list.html.haml
View file @
f8ff70c0
-
if
@domains
.
any?
-
if
can?
(
current_user
,
:update_pages
,
@project
)
&&
@domains
.
any?
.panel.panel-default
.panel.panel-default
.panel-heading
.panel-heading
Domains (
#{
@domains
.
count
}
)
Domains (
#{
@domains
.
count
}
)
...
...
app/views/projects/pages/_no_domains.html.haml
View file @
f8ff70c0
.panel.panel-default
-
if
can?
(
current_user
,
:update_pages
,
@project
)
.panel.panel-default
.panel-heading
.panel-heading
Domains
Domains
.nothing-here-block
.nothing-here-block
...
...
app/views/projects/pages/show.html.haml
View file @
f8ff70c0
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
%h3
.page_title
%h3
.page_title
Pages
Pages
-
if
Gitlab
.
config
.
pages
.
external_http
||
Gitlab
.
config
.
pages
.
external_https
-
if
can?
(
current_user
,
:update_pages
,
@project
)
&&
(
Gitlab
.
config
.
pages
.
external_http
||
Gitlab
.
config
.
pages
.
external_https
)
=
link_to
new_namespace_project_pages_domain_path
(
@project
.
namespace
,
@project
),
class:
'btn btn-new pull-right'
,
title:
'New Domain'
do
=
link_to
new_namespace_project_pages_domain_path
(
@project
.
namespace
,
@project
),
class:
'btn btn-new pull-right'
,
title:
'New Domain'
do
%i
.fa.fa-plus
%i
.fa.fa-plus
New Domain
New Domain
...
...
doc/permissions/permissions.md
View file @
f8ff70c0
...
@@ -47,9 +47,12 @@ documentation](../workflow/add-user/add-user.md).
...
@@ -47,9 +47,12 @@ documentation](../workflow/add-user/add-user.md).
| Manage runners | | | | ✓ | ✓ |
| Manage runners | | | | ✓ | ✓ |
| Manage build triggers | | | | ✓ | ✓ |
| Manage build triggers | | | | ✓ | ✓ |
| Manage variables | | | | ✓ | ✓ |
| Manage variables | | | | ✓ | ✓ |
| Manage pages | | | | ✓ | ✓ |
| Manage pages domains and certificates | | | | ✓ | ✓ |
| Switch visibility level | | | | | ✓ |
| Switch visibility level | | | | | ✓ |
| Transfer project to another namespace | | | | | ✓ |
| Transfer project to another namespace | | | | | ✓ |
| Remove project | | | | | ✓ |
| Remove project | | | | | ✓ |
| Remove pages | | | | | ✓ |
| Force push to protected branches | | | | | |
| Force push to protected branches | | | | | |
| Remove protected branches | | | | | |
| Remove protected branches | | | | | |
...
...
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