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
eb99e5f5
Commit
eb99e5f5
authored
Apr 20, 2016
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused authorization from controller
parent
0b91ff28
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
8 deletions
+2
-8
app/controllers/projects/project_members_controller.rb
app/controllers/projects/project_members_controller.rb
+0
-5
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+1
-1
app/models/ability.rb
app/models/ability.rb
+1
-2
No files found.
app/controllers/projects/project_members_controller.rb
View file @
eb99e5f5
class
Projects::ProjectMembersController
<
Projects
::
ApplicationController
class
Projects::ProjectMembersController
<
Projects
::
ApplicationController
# Authorize
# Authorize
before_action
:authorize_admin_project_member!
,
except:
[
:leave
,
:index
]
before_action
:authorize_admin_project_member!
,
except:
[
:leave
,
:index
]
before_action
:authorize_read_members_list!
,
only:
[
:index
]
def
index
def
index
@project_members
=
@project
.
project_members
@project_members
=
@project
.
project_members
...
@@ -113,8 +112,4 @@ class Projects::ProjectMembersController < Projects::ApplicationController
...
@@ -113,8 +112,4 @@ class Projects::ProjectMembersController < Projects::ApplicationController
def
member_params
def
member_params
params
.
require
(
:project_member
).
permit
(
:user_id
,
:access_level
)
params
.
require
(
:project_member
).
permit
(
:user_id
,
:access_level
)
end
end
def
authorize_read_members_list!
render_403
unless
can?
(
current_user
,
:read_members_list
,
@project
)
end
end
end
app/helpers/projects_helper.rb
View file @
eb99e5f5
...
@@ -144,7 +144,7 @@ module ProjectsHelper
...
@@ -144,7 +144,7 @@ module ProjectsHelper
nav_tabs
<<
:settings
nav_tabs
<<
:settings
end
end
if
can?
(
current_user
,
:read_
members_list
,
project
)
if
can?
(
current_user
,
:read_
project_member
,
project
)
nav_tabs
<<
:team
nav_tabs
<<
:team
end
end
...
...
app/models/ability.rb
View file @
eb99e5f5
...
@@ -189,8 +189,7 @@ class Ability
...
@@ -189,8 +189,7 @@ class Ability
:create_project
,
:create_project
,
:create_issue
,
:create_issue
,
:create_note
,
:create_note
,
:upload_file
,
:upload_file
:read_members_list
]
]
end
end
...
...
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