BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
7534154b
Commit
7534154b
authored
Jan 23, 2013
by
Andrey Kumanyaev
Committed by
Dmitriy Zaporozhets
Jan 24, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add access control in public section to users teams
parent
dcea5220
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
1 deletion
+11
-1
application_controller.rb
app/controllers/teams/application_controller.rb
+7
-0
members_controller.rb
app/controllers/teams/members_controller.rb
+1
-1
projects_controller.rb
app/controllers/teams/projects_controller.rb
+3
-0
No files found.
app/controllers/teams/application_controller.rb
View file @
7534154b
class
Teams
::
ApplicationController
<
ApplicationController
before_filter
:authorize_manage_user_team!
protected
def
user_team
@user_team
||=
UserTeam
.
find_by_path
(
params
[
:team_id
])
end
def
authorize_manage_user_team!
return
access_denied!
unless
can?
(
current_user
,
:manage_user_team
,
user_team
)
end
end
app/controllers/teams/members_controller.rb
View file @
7534154b
class
Teams
::
MembersController
<
Teams
::
ApplicationController
# Authorize
before_filter
:authorize_manage_user_team!
,
only:
[
:new
,
:edit
]
skip_before_filter
:authorize_manage_user_team!
,
only:
[
:index
]
def
index
@members
=
@user_team
.
members
...
...
app/controllers/teams/projects_controller.rb
View file @
7534154b
class
Teams
::
ProjectsController
<
Teams
::
ApplicationController
skip_before_filter
:authorize_manage_user_team!
,
only:
[
:index
]
def
index
@projects
=
user_team
.
projects
@avaliable_projects
=
current_user
.
admin?
?
Project
.
without_team
(
user_team
)
:
(
Project
.
personal
(
current_user
)
+
current_user
.
projects
).
uniq
...
...
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