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
Tatuya Kamada
gitlab-ce
Commits
48ddf9a4
Commit
48ddf9a4
authored
Feb 16, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove task abilities, since we will only ever show the user their own
parent
b05ab108
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
19 deletions
+0
-19
app/controllers/dashboard/tasks_controller.rb
app/controllers/dashboard/tasks_controller.rb
+0
-8
app/models/ability.rb
app/models/ability.rb
+0
-11
No files found.
app/controllers/dashboard/tasks_controller.rb
View file @
48ddf9a4
class
Dashboard::TasksController
<
Dashboard
::
ApplicationController
class
Dashboard::TasksController
<
Dashboard
::
ApplicationController
before_action
:authorize_destroy_task!
,
only:
[
:destroy
]
def
index
def
index
@tasks
=
case
params
[
:state
]
@tasks
=
case
params
[
:state
]
when
'done'
when
'done'
...
@@ -23,12 +21,6 @@ class Dashboard::TasksController < Dashboard::ApplicationController
...
@@ -23,12 +21,6 @@ class Dashboard::TasksController < Dashboard::ApplicationController
private
private
def
authorize_destroy_task!
unless
can?
(
current_user
,
:destroy_task
,
task
)
return
render_404
end
end
def
task
def
task
@task
||=
current_user
.
tasks
.
find
(
params
[
:id
])
@task
||=
current_user
.
tasks
.
find
(
params
[
:id
])
end
end
...
...
app/models/ability.rb
View file @
48ddf9a4
...
@@ -17,7 +17,6 @@ class Ability
...
@@ -17,7 +17,6 @@ class Ability
when
Namespace
then
namespace_abilities
(
user
,
subject
)
when
Namespace
then
namespace_abilities
(
user
,
subject
)
when
GroupMember
then
group_member_abilities
(
user
,
subject
)
when
GroupMember
then
group_member_abilities
(
user
,
subject
)
when
ProjectMember
then
project_member_abilities
(
user
,
subject
)
when
ProjectMember
then
project_member_abilities
(
user
,
subject
)
when
Task
then
task_abilities
(
user
,
subject
)
else
[]
else
[]
end
.
concat
(
global_abilities
(
user
))
end
.
concat
(
global_abilities
(
user
))
end
end
...
@@ -417,16 +416,6 @@ class Ability
...
@@ -417,16 +416,6 @@ class Ability
rules
rules
end
end
def
task_abilities
(
user
,
task
)
rules
=
[]
if
task
&&
task
.
user
==
user
rules
<<
:destroy_task
end
rules
end
def
abilities
def
abilities
@abilities
||=
begin
@abilities
||=
begin
abilities
=
Six
.
new
abilities
=
Six
.
new
...
...
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