Commit eb4178406f1c00d43543884c734efe486fe66c7b

Authored by Daniela Feitosa
1 parent 4dd11514

Remove "Manage Roles" option for person

Only organizations can manage roles
app/views/profile_editor/index.html.erb
@@ -28,7 +28,7 @@ @@ -28,7 +28,7 @@
28 28
29 <%= control_panel_button(_('Manage Content'), 'cms', :controller => 'cms') %> 29 <%= control_panel_button(_('Manage Content'), 'cms', :controller => 'cms') %>
30 30
31 - <%= control_panel_button(_('Manage Roles'), 'roles', :controller => 'profile_roles') %> 31 + <%= control_panel_button(_('Manage Roles'), 'roles', :controller => 'profile_roles') if profile.organization? %>
32 32
33 <% unless profile.enterprise? %> 33 <% unless profile.enterprise? %>
34 <%= case profile.blogs.count 34 <%= case profile.blogs.count
test/functional/profile_editor_controller_test.rb
@@ -1210,4 +1210,10 @@ class ProfileEditorControllerTest &lt; ActionController::TestCase @@ -1210,4 +1210,10 @@ class ProfileEditorControllerTest &lt; ActionController::TestCase
1210 get :header_footer, :profile => user.identifier 1210 get :header_footer, :profile => user.identifier
1211 assert_response :success 1211 assert_response :success
1212 end 1212 end
  1213 +
  1214 + should 'not display button to manage roles on control panel of person' do
  1215 + get :index, :profile => profile.identifier
  1216 + assert_no_tag :tag => 'a', :attributes => { :href => "/myprofile/default_user/profile_roles" }
  1217 + end
  1218 +
1213 end 1219 end