[Git][noosfero/noosfero][master] Remove "Manage Roles" option for person

Daniela Feitosa gitlab at gitlab.com
Mon Oct 5 21:32:14 BRT 2015


Daniela Feitosa pushed to branch master at Noosfero / noosfero


Commits:
eb417840 by Daniela Feitosa at 2015-10-05T21:28:14Z
Remove "Manage Roles" option for person

Only organizations can manage roles

- - - - -


2 changed files:

- app/views/profile_editor/index.html.erb
- test/functional/profile_editor_controller_test.rb


Changes:

=====================================
app/views/profile_editor/index.html.erb
=====================================
--- a/app/views/profile_editor/index.html.erb
+++ b/app/views/profile_editor/index.html.erb
@@ -28,7 +28,7 @@
 
   <%= control_panel_button(_('Manage Content'), 'cms', :controller => 'cms') %>
 
-  <%= control_panel_button(_('Manage Roles'), 'roles', :controller => 'profile_roles') %>
+  <%= control_panel_button(_('Manage Roles'), 'roles', :controller => 'profile_roles') if profile.organization? %>
 
   <% unless profile.enterprise? %>
     <%= case profile.blogs.count


=====================================
test/functional/profile_editor_controller_test.rb
=====================================
--- a/test/functional/profile_editor_controller_test.rb
+++ b/test/functional/profile_editor_controller_test.rb
@@ -1210,4 +1210,10 @@ class ProfileEditorControllerTest < ActionController::TestCase
     get :header_footer, :profile => user.identifier
     assert_response :success
   end
+
+  should 'not display button to manage roles on control panel of person' do
+    get :index, :profile => profile.identifier
+    assert_no_tag :tag => 'a', :attributes => { :href => "/myprofile/default_user/profile_roles" }
+  end
+
 end



View it on GitLab: https://gitlab.com/noosfero/noosfero/commit/eb4178406f1c00d43543884c734efe486fe66c7b
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20151006/3ec08757/attachment-0001.html>


More information about the Noosfero-dev mailing list