<%= error_messages_for 'role' %>


<%= text_field 'role', 'name' %>

<%=_('Permissions')%> <% permissions = @permissions.group_by {|p| p.group_id } %> <% permissions.keys.sort.each do |group_id| %>
<%= _(Permission::GROUPS[group_id]) %> <% permissions[group_id].each do |p| %>
<%= check_box_tag "permission_ids[]", p.id, (@role.permissions.include? p) %> <%= _(p.descr) %>
<% end %>
<% end %>
<%=_('Check all')%> | <%=_('Uncheck all')%>