Commit df6ff9dbbf22b53825ee20afec1a768d63df48f6

Authored by Marcos Pereira
1 parent 0b2e2c3d
Exists in master and in 1 other branch mezuro_spb

Revert "Only admins can create_institution"

This reverts commit df7534e3b26c065e271f02ec868ddc06c4fc9a06.
src/noosfero-spb/gov_user/controllers/gov_user_plugin_controller.rb
... ... @@ -5,8 +5,6 @@ class GovUserPluginController < ApplicationController
5 5 :governmental_sphere, :governmental_power, :juridical_nature, :sisp
6 6 ]
7 7  
8   - protect "create_institution_admin", :environment, :except => [:get_institutions]
9   -
10 8 def hide_registration_incomplete_percentage
11 9 response = false
12 10  
... ...
src/noosfero-spb/gov_user/features/institution_registration.feature
... ... @@ -47,11 +47,3 @@ Feature: Institution Field
47 47 And I should not see "community_city"
48 48 And I select "Brazil" from "community_country"
49 49 Then I should not see "Gama"
50   -
51   - @selenium
52   - Scenario: Ordinary user can not create a new institution
53   - Given the following user
54   - | login |
55   - | ordinary_user |
56   - And I am logged in as "ordinary_user"
57   - Then I should not see "Create new institution"
... ...
src/noosfero-spb/gov_user/views/person_editor_extras.html.erb
... ... @@ -12,9 +12,7 @@
12 12  
13 13 <%= content_tag(:div, _("No institution found"), :id=>"institution_empty_ajax_message", :class=>"errorExplanation hide-field") %>
14 14  
15   - <% if context.profile.user && context.profile.user.person.is_admin? %>
16   - <%= InstitutionModalHelper.modal_button %>
17   - <% end %>
  15 + <%= InstitutionModalHelper.modal_button %>
18 16  
19 17 <%= hidden_field_tag("user[institution_ids][]", "", :class => 'user_institutions') %>
20 18 <%= hidden_field_tag("institution_selected", "") %>
... ...
src/noosfero-spb/gov_user/views/ratings_extra_field.html.erb
... ... @@ -5,9 +5,7 @@
5 5  
6 6 <div id="institution_empty_ajax_message" class="errorExplanation hide-field rating-create-institution-container">
7 7 <span class="institution-not-found"><%= _("No organization or company found") %></span>
8   - <% if user && user.is_admin? %>
9   - <%= InstitutionModalHelper.modal_button(_("Add"), "none") %>
10   - <% end %>
  8 + <%= InstitutionModalHelper.modal_button(_("Add"), "none") %>
11 9 </div>
12 10  
13 11 <%= hidden_field_tag "organization_rating[institution_id]", "", id: "institution_selected" %>
... ...