From 66ec9c88ecd330f74780c7d9e42f3fb67d124f57 Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Fri, 13 Sep 2013 19:55:01 +0600 Subject: [PATCH 1/3] [#277] fix edit link --- app/views/shared/_profile.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/shared/_profile.html.haml b/app/views/shared/_profile.html.haml index 9fdcc553a..51a229d0d 100644 --- a/app/views/shared/_profile.html.haml +++ b/app/views/shared/_profile.html.haml @@ -17,7 +17,7 @@ %p{:title => user.try(:name)} - if user = short_message(user.name, 28) - = link_to image_tag('gears.png'), edit_url if can?(:edit, user) + = link_to image_tag('gears.png'), edit_url if edit_url.present? .both - if user %p.info.first From 9ef58d8444703a2ee764525a1269079a4979f072 Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Fri, 13 Sep 2013 20:00:21 +0600 Subject: [PATCH 2/3] [#277] fix edit user link --- app/models/ability.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/ability.rb b/app/models/ability.rb index f631c29e3..ae81521ab 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -48,6 +48,7 @@ class Ability end if user.user? + can :edit, User, :id => user.id can [:read, :create], Group can [:update, :manage_members, :members, :add_member, :remove_member, :update_member], Group do |group| group.actors.exists?(:actor_type => 'User', :actor_id => user.id, :role => 'admin') # or group.owner_id = user.id From e0133c48fa8a7ef2daf47df752c04f6734346bf2 Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Fri, 13 Sep 2013 20:17:07 +0600 Subject: [PATCH 3/3] [#277] fix profile specs --- spec/controllers/groups/profile_controller_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/controllers/groups/profile_controller_spec.rb b/spec/controllers/groups/profile_controller_spec.rb index 08abcca95..2cf0af840 100644 --- a/spec/controllers/groups/profile_controller_spec.rb +++ b/spec/controllers/groups/profile_controller_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' shared_examples_for 'group user with project show rights' do it 'should be able to perform show action' do - get :show, :id => @group + get :show, :uname => @group.uname response.should render_template(:show) end end