Hi,
I have recent versions (as of 2/5/2006) LoginEngine and UserEngine
installed and I can login in via admin, create users, etc. That part
seems to be working. I’m having trouble setting permissions, roles, etc.
When I go to http://localhost:3000/role/list I get an exception:
Showing vendor/plugins/user_engine/app/views/role/list.rhtml where
line #18 raised:
undefined method `link_if_authorized’ for
#<#Class:0x408502e8:0x408501e4>
Extracted source (around line #18):
15: <% end %>
16:
17:
18: <%= link_if_authorized ‘Show’, {:action => ‘show’, :id =>
role}, :wrap_in => “li” %>
19: <%= link_if_authorized ‘Edit’, {:action => ‘edit’, :id =>
role}, :wrap_in => “li” %>
20: <% if authorized?(:action => ‘destroy’) && (not
UserEngine.config([:guest_role_name, :user_role_name,
:admin_role_name]).include?(role.name)) %>
21: <%= button_to ‘Destroy’, :action => ‘destroy’, :id => role
%><% end %>
18: <%= link_if_authorized ‘Show’, {:action => ‘show’, :id =>
role}, :wrap_in => “li” %>
19: <%= link_if_authorized ‘Edit’, {:action => ‘edit’, :id =>
role}, :wrap_in => “li” %>
20: <% if authorized?(:action => ‘destroy’) && (not
UserEngine.config([:guest_role_name, :user_role_name,
:admin_role_name]).include?(role.name)) %>
21: <%= button_to ‘Destroy’, :action => ‘destroy’, :id => role
%><% end %>
which essentially means that the application can’t find
link_if_authorized(). This happens with user/list and permission/list so
I think this is a generic problem for the admin pages/controllers.
The big-picture question: What’s the right way to get into the
permissions system (user/list, permission/list, role/list, etc.)? I’ve
done this before by reverse-engineering the controllers because I
couldn’t find any documentation on UserEngine administration. user/home
is blank by design; is there a right way (or a wrong way) to get to the
permissions pages?
Smaller-picture question: if this is a generic issue for the permission
system, where do I have to poke my application so it can find
link_if_authorized()?
I’ve done ‘rake engine_migrate’, ‘rake bootstrap’, and ‘rake
sync_permissions’; the users.role column is NULL for every user, and
users_roles for three users (user_id == 1 is admin) looks like:
±--------±--------+
| user_id | role_id |
±--------±--------+
| 1 | 3 |
| 1 | 2 |
| 2 | 3 |
| 3 | 3 |
±--------±--------+
Anything else I should be looking at to chase this down?
Thanks much,
– Bob