Hello everyone,
I was trying to set up access control in a new application Im working
on,
I’m trying to use the excellent authorization plugin from Bill K.,
Its pretty straight forward to setup and should be to use.
But when i try to give the same permission on two differents users on
the same object i get an error.
(Well , Im kinda new to all this rails stuff)
r = Red.find(1)
u1 = User.find_by_login(“ismael”)
u2 = User.find_by_login(“ismael2”)
u1.has_role “proprio”, r
u2.has_role “proprio”, r
ActiveRecord::StatementInvalid: Mysql::Error: Duplicate entry ‘5’ for
key 1: INSERT INTO roles_users (updated_at
, role_id
, id
,
user_id
, created_at
) VALUES (‘2006-07-11 13:58:35’, 5, 5, 20,
‘2006-07-11 13:58:35’)
I know what the Duplicate key mean, but am I using the plugin
correctly or you cant have 2 users with the same permission on the
same object?
thank you
–
ph,
[email protected] :r&d web
tél: 514.678.6066