I need to improve my application even more …
I currently have an application, which makes user registration is authentica …
But my big problem …
Everyone who registers, has all the privileges …
I need to create a user group
Ex:
Administrator
Default user
Default user 2
What do tell me about it?
I really do not even know where to start hehe
1 Like
Simpliest would be to add is_admin boolean field to User…
More complex example would have something like
User many_to_many Role
Role many_to_many User
2 Likes
There is some step by step to add, this simpler mode with is_admin: boolean
Could you pass me a template, which does not show the edit button and delete for common user and admin user show all?
Note:
Is there a column called is_admin that returns “boolean” default value false
template layout
…
> <td class="text-right">
> <span><%= link "Detalhes", to: todos_path(@conn, :show, todos), class: "btn btn-default btn-xs" %></span>
> <span><%= link "Editar", to: todos_path(@conn, :edit, todos), class: "btn btn-default btn-xs" %></span>
> <span><%= link "Deletar", to: todos_path(@conn, :delete, todos), method: :delete, data: [confirm: "Are you sure?"], class: "btn btn-danger btn-xs" %></span>
> <% end %>
…
This template question, I was able to solve already …
Now I’ll have to deal with my controller.