Skip to content

Commit

Permalink
User permissions for uncomplete task
Browse files Browse the repository at this point in the history
  • Loading branch information
steveyken committed Aug 23, 2014
1 parent 36110f6 commit 6369bf8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/entities_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def versions

#----------------------------------------------------------------------------
def field_group
if @tag = Tag.find_or_create_by_name(params[:tag].strip)
if @tag = Tag.find_by_name(params[:tag].strip)
if @field_group = FieldGroup.find_by_tag_id_and_klass_name(@tag.id, klass.to_s)
@asset = klass.find_by_id(params[:asset_id]) || klass.new
render 'fields/group' and return
Expand Down
1 change: 1 addition & 0 deletions app/models/users/ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def initialize(user)
can :create, Task
can :manage, Task, user: user.id
can :manage, Task, assigned_to: user.id
can :manage, Task, completed_by: user.id

# Entities
can :manage, entities, :access => 'Public'
Expand Down
2 changes: 1 addition & 1 deletion app/views/tasks/_completed.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
.tools
- if shown_on_landing_page?
= link_to_discard(completed) + (current_user == completed.user ? ' | ' : '')
- if current_user == completed.user
- if can?(:manage, completed)
= link_to_task_uncomplete(completed, bucket) + ' | '
= link_to_task_delete(completed, bucket)

Expand Down

0 comments on commit 6369bf8

Please # to comment.