noosfero | Add environment permission to not allow user to delete a profile (#648)

Daniela Feitosa gitlab at gitlab.com
Fri Aug 7 09:10:03 BRT 2015


New comment for Merge Request 648

https://gitlab.com/noosfero/noosfero/merge_requests/648#note_1843898


Daniela Feitosa

Those `if`'s and `elsif` are being used to display the same button. You can join them in one line condition.  It will be a long line, but I think it's better than repeat the code for the button:

```
<% if (user.has_permission?(:destroy_profile, group) && !environment.enabled?('forbid_destroy_profile')) || user.is_admin?(environment) %>
  <%= button 'delete', _('Remove'), { :controller => 'profile_editor', :action => 'destroy_profile', :profile => group.identifier } %>
<% end %>
```

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20150807/7ddbdcd5/attachment.html>


More information about the Noosfero-dev mailing list