# Logfile created on Mon Mar 03 21:20:10 -0500 2008SQL (0.000811) SHOW client_min_messages SQL (0.000444) SET client_min_messages TO 'panic' SQL (0.000416) SHOW standard_conforming_strings SQL (0.000352) SET client_min_messages TO 'notice' SQL (0.000890) SELECT version() SQL (0.000890) BEGIN SQL (0.000428) ROLLBACK SQL (0.000636) BEGIN Firm Load (0.002640) SELECT * FROM firms WHERE (firms.name IS NULL) LIMIT 1 Firm Load (0.000676) SELECT * FROM firms WHERE (firms.full_name IS NULL) LIMIT 1 Firm Load (0.001486) SELECT * FROM firms WHERE (firms.name = E'') LIMIT 1 Firm Load (0.000526) SELECT * FROM firms WHERE (firms.full_name IS NULL) LIMIT 1 Firm Load (0.000723) SELECT * FROM firms WHERE (firms.name = E'a') LIMIT 1 Firm Load (0.000517) SELECT * FROM firms WHERE (firms.full_name IS NULL) LIMIT 1 Firm Load (0.002713) SELECT * FROM firms WHERE (firms.name = E'ab') LIMIT 1 Firm Load (0.001065) SELECT * FROM firms WHERE (firms.full_name IS NULL) LIMIT 1 Firm Load (0.001890) SELECT * FROM firms WHERE (firms.name = E'Shire') LIMIT 1 Firm Load (0.000664) SELECT * FROM firms WHERE (firms.full_name IS NULL) LIMIT 1 Firm Load (0.000947) SELECT * FROM firms WHERE (firms.name = E'Dubuque') LIMIT 1 Firm Load (0.000578) SELECT * FROM firms WHERE (firms.full_name IS NULL) LIMIT 1 Firm Load (0.000954) SELECT * FROM firms WHERE (firms.name = E'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx') LIMIT 1 Firm Load (0.000560) SELECT * FROM firms WHERE (firms.full_name IS NULL) LIMIT 1 Firm Load (0.000947) SELECT * FROM firms WHERE (firms.name = E'rocky') LIMIT 1 Firm Load (0.000540) SELECT * FROM firms WHERE (firms.full_name IS NULL) LIMIT 1 Firm Load (0.000901) SELECT * FROM firms WHERE (firms.name = E'bullwinkle') LIMIT 1 Firm Load (0.000523) SELECT * FROM firms WHERE (firms.full_name IS NULL) LIMIT 1 Firm Load (0.001184) SELECT * FROM firms WHERE (firms.name = E'bullwinkle') LIMIT 1 Firm Load (0.001024) SELECT * FROM firms WHERE (firms.full_name = E'') LIMIT 1 Firm Load (0.000725) SELECT * FROM firms WHERE (firms.name = E'bullwinkle') LIMIT 1 Firm Load (0.000785) SELECT * FROM firms WHERE (firms.full_name = E'a') LIMIT 1 Firm Load (0.000679) SELECT * FROM firms WHERE (firms.name = E'bullwinkle') LIMIT 1 Firm Load (0.000703) SELECT * FROM firms WHERE (firms.full_name = E'ab') LIMIT 1 Firm Load (0.002877) SELECT * FROM firms WHERE (firms.name = E'bullwinkle') LIMIT 1 Firm Load (0.000966) SELECT * FROM firms WHERE (firms.full_name = E'Bank of the Shire') LIMIT 1 Firm Load (0.000881) SELECT * FROM firms WHERE (firms.name = E'bullwinkle') LIMIT 1 Firm Load (0.000942) SELECT * FROM firms WHERE (firms.full_name = E'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx') LIMIT 1 Firm Load (0.001201) SELECT * FROM firms WHERE (firms.name = E'bullwinkle') LIMIT 1 Firm Load (0.000802) SELECT * FROM firms WHERE (firms.full_name = E'rocky') LIMIT 1 Firm Load (0.000702) SELECT * FROM firms WHERE (firms.name = E'bullwinkle') LIMIT 1 Firm Load (0.000715) SELECT * FROM firms WHERE (firms.full_name = E'bullwinkle') LIMIT 1 Firm Load (0.000694) SELECT * FROM firms WHERE (firms.name = E'bullwinkle') LIMIT 1 Firm Load (0.002604) SELECT * FROM firms WHERE (firms.full_name = E'bullwinkle') LIMIT 1 Firm Load (0.000726) SELECT * FROM firms WHERE (firms.name = E'bullwinkle') LIMIT 1 Firm Load (0.000690) SELECT * FROM firms WHERE (firms.full_name = E'bullwinkle') LIMIT 1 Firm Load (0.000678) SELECT * FROM firms WHERE (firms.name = E'bullwinkle') LIMIT 1 Firm Load (0.000694) SELECT * FROM firms WHERE (firms.full_name = E'bullwinkle') LIMIT 1 Firm Load (0.000684) SELECT * FROM firms WHERE (firms.name = E'bullwinkle') LIMIT 1 Firm Load (0.000682) SELECT * FROM firms WHERE (firms.full_name = E'bullwinkle') LIMIT 1 Firm Load (0.002750) SELECT * FROM firms WHERE (firms.name = E'bullwinkle') LIMIT 1 Firm Load (0.003777) SELECT * FROM firms WHERE (firms.full_name = E'bullwinkle') LIMIT 1 Firm Load (0.000907) SELECT * FROM firms WHERE (firms.name = E'bullwinkle') LIMIT 1 Firm Load (0.001018) SELECT * FROM firms WHERE (firms.full_name = E'bullwinkle') LIMIT 1 Firm Load (0.001891) SELECT * FROM firms WHERE (firms.name = E'bullwinkle') LIMIT 1 Firm Load (0.000860) SELECT * FROM firms WHERE (firms.full_name = E'bullwinkle') LIMIT 1 Firm Load (0.019638) SELECT * FROM firms WHERE (firms.name = E'bullwinkle') LIMIT 1 Firm Load (0.002770) SELECT * FROM firms WHERE (firms.full_name = E'bullwinkle') LIMIT 1 Firm Load (0.000946) SELECT * FROM firms WHERE (firms.name = E'bullwinkle') LIMIT 1 Firm Load (0.000721) SELECT * FROM firms WHERE (firms.full_name = E'bullwinkle') LIMIT 1 Firm Load (0.004069) SELECT * FROM firms WHERE (firms.name = E'bullwinkle') LIMIT 1 Firm Load (0.000874) SELECT * FROM firms WHERE (firms.full_name = E'bullwinkle') LIMIT 1 Firm Load (0.000808) SELECT * FROM firms WHERE (firms.name = E'bullwinkle') LIMIT 1 Firm Load (0.000761) SELECT * FROM firms WHERE (firms.full_name = E'bullwinkle') LIMIT 1 Firm Load (0.000787) SELECT * FROM firms WHERE (firms.name = E'bullwinkle') LIMIT 1 Firm Load (0.005355) SELECT * FROM firms WHERE (firms.full_name = E'bullwinkle') LIMIT 1 Firm Load (0.000908) SELECT * FROM firms WHERE (firms.name = E'bullwinkle') LIMIT 1 Firm Load (0.000898) SELECT * FROM firms WHERE (firms.full_name = E'bullwinkle') LIMIT 1 Firm Load (0.000899) SELECT * FROM firms WHERE (firms.name = E'bullwinkle') LIMIT 1 Firm Load (0.000918) SELECT * FROM firms WHERE (firms.full_name = E'bullwinkle') LIMIT 1 Firm Load (0.000738) SELECT * FROM firms WHERE (firms.name = E'bullwinkle') LIMIT 1 Firm Load (0.000706) SELECT * FROM firms WHERE (firms.full_name = E'bullwinkle') LIMIT 1 Firm Load (0.000814) SELECT * FROM firms WHERE (firms.name = E'bullwinkle') LIMIT 1 Firm Load (0.000866) SELECT * FROM firms WHERE (firms.full_name = E'bullwinkle') LIMIT 1 Firm Load (0.000776) SELECT * FROM firms WHERE (firms.name = E'bullwinkle') LIMIT 1 Firm Load (0.000730) SELECT * FROM firms WHERE (firms.full_name = E'bullwinkle') LIMIT 1 User Load (0.001395) SELECT * FROM users WHERE (users."id" = 5) User Load (0.001049) SELECT * FROM users WHERE (users."id" = 6) SQL (0.000550) SHOW max_identifier_length SQL (0.001042) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Firm Load (0.000768) SELECT * FROM firms WHERE (firms."id" = 2) Role Load (0.001584) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 Permission Load (0.003738) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 6 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: create Role test role() PK and serial sequence (0.005873) SELECT attr.attname, seq.relname FROM pg_class seq, pg_attribute attr, pg_depend dep, pg_namespace name, pg_constraint cons WHERE seq.oid = dep.objid AND seq.relkind = 'S' AND attr.attrelid = dep.refobjid AND attr.attnum = dep.refobjsubid AND attr.attrelid = cons.conrelid AND attr.attnum = cons.conkey[1] AND cons.contype = 'p' AND dep.refobjid = 'roles'::regclass Role Create (0.001216) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:12.175507', 2, E'test role', 5, '2008-03-03 21:20:12.175507') SQL (0.000609) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) Firm Load (0.000863) SELECT * FROM firms WHERE (firms."id" = 2) SQL (0.002436) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(6) SQL (0.002193) select 'x' from roles where id = 6 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) PK and serial sequence (0.004004) SELECT attr.attname, seq.relname FROM pg_class seq, pg_attribute attr, pg_depend dep, pg_namespace name, pg_constraint cons WHERE seq.oid = dep.objid AND seq.relkind = 'S' AND attr.attrelid = dep.refobjid AND attr.attnum = dep.refobjsubid AND attr.attrelid = cons.conrelid AND attr.attnum = cons.conkey[1] AND cons.contype = 'p' AND dep.refobjid = 'role_assignments'::regclass RoleAssignment Create (0.000622) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:12.210339', 6, 5, NULL, '2008-03-03 21:20:12.210339', NULL) SQL (0.000265) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000734) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001475) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001092) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) Firm Load (0.000948) SELECT * FROM firms WHERE (firms.name = E'bullwinkle') LIMIT 1 Firm Load (0.000878) SELECT * FROM firms WHERE (firms.full_name = E'bullwinkle') LIMIT 1 === FAILED permission check: create Firm bullwinkle() === permission check: edit Role test role(6) SQL (0.002089) select 'x' from roles where id = 6 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) PK and serial sequence (0.005596) SELECT attr.attname, seq.relname FROM pg_class seq, pg_attribute attr, pg_depend dep, pg_namespace name, pg_constraint cons WHERE seq.oid = dep.objid AND seq.relkind = 'S' AND attr.attrelid = dep.refobjid AND attr.attnum = dep.refobjsubid AND attr.attrelid = cons.conrelid AND attr.attnum = cons.conkey[1] AND cons.contype = 'p' AND dep.refobjid = 'permissions'::regclass Permission Create (0.001054) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Firm', 'f', 'f', '2008-03-03 21:20:12.238098', NULL, NULL, 6, NULL, 'f', NULL, '2008-03-03 21:20:12.238098', E'create', NULL) SQL (0.000522) SELECT currval('permissions_id_seq') Permission Load (0.001193) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) Firm Load (0.001007) SELECT * FROM firms WHERE (firms.name = E'bullwinkle') LIMIT 1 Firm Load (0.000837) SELECT * FROM firms WHERE (firms.full_name = E'bullwinkle') LIMIT 1 === permission check: create Firm bullwinkle() PK and serial sequence (0.005668) SELECT attr.attname, seq.relname FROM pg_class seq, pg_attribute attr, pg_depend dep, pg_namespace name, pg_constraint cons WHERE seq.oid = dep.objid AND seq.relkind = 'S' AND attr.attrelid = dep.refobjid AND attr.attnum = dep.refobjsubid AND attr.attrelid = cons.conrelid AND attr.attnum = cons.conkey[1] AND cons.contype = 'p' AND dep.refobjid = 'firms'::regclass Firm Create (0.000901) INSERT INTO firms ("name", "updated_at", "bad_login_dead_minutes", "search_name", "full_name", "max_bad_logins", "password_lifetime_days", "created_at") VALUES(E'bullwinkle', '2008-03-03 21:20:12.255051', NULL, E'bullwinkle', E'bullwinkle', 20, 1000, '2008-03-03 21:20:12.228708') SQL (0.000477) SELECT currval('firms_id_seq') === permission check: destroy Role test role(6) Role Destroy (0.001404) DELETE FROM roles WHERE "id" = 6 RoleAssignment Load (0.000562) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000486) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000537) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001120) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000745) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Role Load (0.001079) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 === permission check: create Role test role() Role Create (0.000979) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:12.282732', 2, E'test role', 5, '2008-03-03 21:20:12.282732') SQL (0.000426) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) SQL (0.001902) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(7) SQL (0.001937) select 'x' from roles where id = 7 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.001038) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:12.300681', 7, 5, NULL, '2008-03-03 21:20:12.300681', NULL) SQL (0.000452) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000752) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001340) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001057) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: destroy Firm bullwinkle(5) === permission check: edit Role test role(7) SQL (0.002218) select 'x' from roles where id = 7 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001051) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Firm', 'f', 'f', '2008-03-03 21:20:12.319555', NULL, NULL, 7, NULL, 'f', NULL, '2008-03-03 21:20:12.319555', E'destroy', NULL) SQL (0.000430) SELECT currval('permissions_id_seq') Permission Load (0.001337) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: destroy Firm bullwinkle(5) Firm Destroy (0.004892) DELETE FROM firms WHERE "id" = 5 === permission check: destroy Role test role(7) Role Destroy (0.000832) DELETE FROM roles WHERE "id" = 7 RoleAssignment Load (0.000648) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000740) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000681) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001132) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000707) ROLLBACK SQL (0.000329) BEGIN User Load (0.000788) SELECT * FROM users WHERE (users."id" = 2) User Load (0.000796) SELECT * FROM users WHERE (users."id" = 5) User Load (0.000759) SELECT * FROM users WHERE (users."id" = 6) SQL (0.000780) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Firm Load (0.000806) SELECT * FROM firms WHERE (firms."id" = 2) Role Load (0.000993) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 Permission Load (0.002349) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 6 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: create Role test role() Role Create (0.001120) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:12.357977', 2, E'test role', 5, '2008-03-03 21:20:12.357977') SQL (0.000489) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) Firm Load (0.000890) SELECT * FROM firms WHERE (firms."id" = 2) SQL (0.001944) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(8) SQL (0.001986) select 'x' from roles where id = 8 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.000822) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:12.383172', 8, 5, NULL, '2008-03-03 21:20:12.383172', NULL) SQL (0.000394) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000923) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001194) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001187) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) Store Load (0.000988) SELECT * FROM stores WHERE (stores."id" = 2) Firm Load (0.000942) SELECT * FROM firms WHERE (firms."id" = 3) === FAILED permission check: place Order X() === permission check: edit Role test role(8) SQL (0.002063) select 'x' from roles where id = 8 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001578) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Order', 'f', 'f', '2008-03-03 21:20:12.413025', NULL, NULL, 8, NULL, 'f', NULL, '2008-03-03 21:20:12.413025', E'place', 2) SQL (0.000435) SELECT currval('permissions_id_seq') Permission Load (0.001250) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: place Order X() PK and serial sequence (0.005879) SELECT attr.attname, seq.relname FROM pg_class seq, pg_attribute attr, pg_depend dep, pg_namespace name, pg_constraint cons WHERE seq.oid = dep.objid AND seq.relkind = 'S' AND attr.attrelid = dep.refobjid AND attr.attnum = dep.refobjsubid AND attr.attrelid = cons.conrelid AND attr.attnum = cons.conkey[1] AND cons.contype = 'p' AND dep.refobjid = 'orders'::regclass Order Create (0.001119) INSERT INTO orders ("shipped", "updated_at", "notes", "owner_firm_id", "paid", "owner_id", "shipping_address", "store_id", "payment_authenticator", "created_at") VALUES('f', '2008-03-03 21:20:12.423213', NULL, 3, 'f', 2, NULL, 2, NULL, '2008-03-03 21:20:12.423213') SQL (0.000472) SELECT currval('orders_id_seq') === permission check: destroy Role test role(8) Role Destroy (0.000963) DELETE FROM roles WHERE "id" = 8 RoleAssignment Load (0.000671) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000525) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000593) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001046) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000548) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Role Load (0.000945) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 === permission check: create Role test role() Role Create (0.001018) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:12.450580', 2, E'test role', 5, '2008-03-03 21:20:12.450580') SQL (0.000463) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) SQL (0.001992) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(9) SQL (0.002130) select 'x' from roles where id = 9 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.000882) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:12.471122', 9, 5, NULL, '2008-03-03 21:20:12.471122', NULL) SQL (0.000415) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000633) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001206) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001045) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) Offer Load (0.000907) SELECT * FROM offers WHERE (offers."id" = 1) === FAILED permission check: edit Order X(3) === permission check: edit Role test role(9) SQL (0.002237) select 'x' from roles where id = 9 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001102) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Order', 'f', 'f', '2008-03-03 21:20:12.491293', 3, NULL, 9, NULL, 'f', NULL, '2008-03-03 21:20:12.491293', E'edit', NULL) SQL (0.000520) SELECT currval('permissions_id_seq') Permission Load (0.001374) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: edit Order X(3) Firm Load (0.000916) SELECT * FROM firms WHERE (firms."id" = 2) SQL (0.002291) select 'x' from orders where id = 3 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 5 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Order') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or orders.owner_id = 5) and (p.target_id is null or orders.id = p.target_id) and (p.target_owner_id is null or orders.owner_id = p.target_owner_id) and (p.target_paid is null or orders.paid = p.target_paid) ) === permission check: destroy Role test role(9) Role Destroy (0.000919) DELETE FROM roles WHERE "id" = 9 RoleAssignment Load (0.000541) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000517) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000562) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001104) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000696) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Role Load (0.001540) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 === permission check: create Role test role() Role Create (0.000971) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:12.525063', 2, E'test role', 5, '2008-03-03 21:20:12.525063') SQL (0.000399) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) SQL (0.001867) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(10) SQL (0.002664) select 'x' from roles where id = 10 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.002242) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:12.543422', 10, 5, NULL, '2008-03-03 21:20:12.543422', NULL) SQL (0.001080) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.001093) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001173) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001153) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: edit Order X(3) === permission check: edit Role test role(10) SQL (0.002117) select 'x' from roles where id = 10 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.000935) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Order', 'f', 'f', '2008-03-03 21:20:12.566900', 3, NULL, 10, NULL, 'f', NULL, '2008-03-03 21:20:12.566900', E'edit', NULL) SQL (0.000432) SELECT currval('permissions_id_seq') Permission Load (0.001760) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: edit Order X(3) === permission check: edit Order X(3) === permission check: edit Order X(3) === permission check: edit Order X(3) === permission check: edit Order X(3) === permission check: edit Order X(3) === permission check: edit Order X(3) === permission check: edit Order X(3) === permission check: edit Order X(3) === permission check: edit Order X(3) === permission check: edit Order X(3) === permission check: edit Order X(3) === permission check: edit Order X(3) === permission check: edit Order X(3) === permission check: destroy Role test role(10) Role Destroy (0.001019) DELETE FROM roles WHERE "id" = 10 RoleAssignment Load (0.000566) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000520) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000582) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001215) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) PK and serial sequence (0.005839) SELECT attr.attname, seq.relname FROM pg_class seq, pg_attribute attr, pg_depend dep, pg_namespace name, pg_constraint cons WHERE seq.oid = dep.objid AND seq.relkind = 'S' AND attr.attrelid = dep.refobjid AND attr.attnum = dep.refobjsubid AND attr.attrelid = cons.conrelid AND attr.attnum = cons.conkey[1] AND cons.contype = 'p' AND dep.refobjid = 'line_items'::regclass LineItem Create (0.000894) INSERT INTO line_items ("offer_id", "order_id", "quantity") VALUES(1, 3, 50) SQL (0.000492) SELECT currval('line_items_id_seq') SQL (0.000576) ROLLBACK SQL (0.000387) BEGIN Product Load (0.001049) SELECT * FROM products WHERE (products."id" = 1) Store Load (0.000825) SELECT * FROM stores WHERE (stores."id" = 2) User Load (0.000966) SELECT * FROM users WHERE (users."id" = 5) User Load (0.001011) SELECT * FROM users WHERE (users."id" = 6) SQL (0.000749) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Firm Load (0.000657) SELECT * FROM firms WHERE (firms."id" = 2) Role Load (0.000985) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 Permission Load (0.001424) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 6 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: create Role test role() Role Create (0.000976) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:12.643013', 2, E'test role', 5, '2008-03-03 21:20:12.643013') SQL (0.000422) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) Firm Load (0.000906) SELECT * FROM firms WHERE (firms."id" = 2) SQL (0.001939) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(11) SQL (0.001922) select 'x' from roles where id = 11 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.000859) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:12.665740', 11, 5, NULL, '2008-03-03 21:20:12.665740', NULL) SQL (0.000395) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000722) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001176) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001220) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: manage_offers Store Ricky's Music Stuff(2) === permission check: edit Role test role(11) SQL (0.002251) select 'x' from roles where id = 11 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001147) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Product', 'f', 'f', '2008-03-03 21:20:12.685094', 1, E'tenor saxophone', 11, NULL, 'f', NULL, '2008-03-03 21:20:12.685094', E'offer_for_sale', NULL) SQL (0.000455) SELECT currval('permissions_id_seq') Permission Load (0.001368) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === FAILED permission check: manage_offers Store Ricky's Music Stuff(2) Role Load (0.000819) SELECT * FROM roles WHERE (roles."id" = 3) === permission check: edit Role test role(11) === permission check: edit Role twiddler(3) SQL (0.001912) select 'x' from roles where id = 11 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) SQL (0.001761) select 'x' from roles where id = 3 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Update (0.001531) UPDATE permissions SET "created_at" = '2008-03-03 21:20:12.685094', "role_id" = 3, "target_owned_by_self" = 'f', "target_name" = E'tenor saxophone', "has_grant_option" = 'f', "is_grant" = 'f', "class_name" = E'Product', "target_owner_id" = NULL, "privilege" = E'offer_for_sale', "target_owner_firm_id" = NULL, "target_id" = 1, "updated_at" = '2008-03-03 21:20:12.706293', "target_paid" = NULL WHERE "id" = 608 === permission check: edit Role test role(11) SQL (0.001963) select 'x' from roles where id = 11 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.000993) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Store', 'f', 'f', '2008-03-03 21:20:12.717148', 2, E'Ricky''s Music Stuff', 11, NULL, 'f', NULL, '2008-03-03 21:20:12.717148', E'manage_offers', NULL) SQL (0.000461) SELECT currval('permissions_id_seq') Permission Load (0.001436) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: manage_offers Store Ricky's Music Stuff(2) Firm Load (0.000936) SELECT * FROM firms WHERE (firms."id" = 2) SQL (0.002150) select 'x' from stores where id = 2 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 5 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'manage_offers' or p.privilege = 'any') and (p.class_name = E'Store') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or stores.owner_id = 5) and (p.target_owner_id is null or stores.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or stores.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or stores.id = p.target_id) ) === FAILED permission check: offer_for_sale Product tenor saxophone(1) === permission check: edit Role test role(11) === permission check: edit Role twiddler(3) SQL (0.002260) select 'x' from roles where id = 11 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) SQL (0.001903) select 'x' from roles where id = 3 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Update (0.001045) UPDATE permissions SET "created_at" = '2008-03-03 21:20:12.717148', "role_id" = 3, "target_owned_by_self" = 'f', "target_name" = E'Ricky''s Music Stuff', "has_grant_option" = 'f', "is_grant" = 'f', "class_name" = E'Store', "target_owner_id" = NULL, "privilege" = E'manage_offers', "target_owner_firm_id" = NULL, "target_id" = 2, "updated_at" = '2008-03-03 21:20:12.744329', "target_paid" = NULL WHERE "id" = 609 === permission check: edit Role twiddler(3) === permission check: edit Role test role(11) SQL (0.002419) select 'x' from roles where id = 3 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) SQL (0.001768) select 'x' from roles where id = 11 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Update (0.001012) UPDATE permissions SET "created_at" = '2008-03-03 21:20:12.685094', "role_id" = 11, "target_owned_by_self" = 'f', "target_name" = E'tenor saxophone', "has_grant_option" = 'f', "is_grant" = 'f', "class_name" = E'Product', "target_owner_id" = NULL, "privilege" = E'offer_for_sale', "target_owner_firm_id" = NULL, "target_id" = 1, "updated_at" = '2008-03-03 21:20:12.759220', "target_paid" = NULL WHERE "id" = 608 === permission check: edit Role twiddler(3) === permission check: edit Role test role(11) SQL (0.005011) select 'x' from roles where id = 3 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) SQL (0.002019) select 'x' from roles where id = 11 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Update (0.001087) UPDATE permissions SET "created_at" = '2008-03-03 21:20:12.717148', "role_id" = 11, "target_owned_by_self" = 'f', "target_name" = E'Ricky''s Music Stuff', "has_grant_option" = 'f', "is_grant" = 'f', "class_name" = E'Store', "target_owner_id" = NULL, "privilege" = E'manage_offers', "target_owner_firm_id" = NULL, "target_id" = 2, "updated_at" = '2008-03-03 21:20:12.780873', "target_paid" = NULL WHERE "id" = 609 Permission Load (0.001217) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: manage_offers Store Ricky's Music Stuff(2) SQL (0.002101) select 'x' from stores where id = 2 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 5 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'manage_offers' or p.privilege = 'any') and (p.class_name = E'Store') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or stores.owner_id = 5) and (p.target_owner_id is null or stores.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or stores.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or stores.id = p.target_id) ) === permission check: offer_for_sale Product tenor saxophone(1) SQL (0.002233) select 'x' from products where id = 1 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 5 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'offer_for_sale' or p.privilege = 'any') and (p.class_name = E'Product') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or products.owner_id = 5) and (p.target_owner_id is null or products.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or products.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or products.id = p.target_id) ) === permission check: manage_offers Store Ricky's Music Stuff(2) === permission check: manage_offers Store Ricky's Music Stuff(2) === permission check: destroy Role test role(11) Role Destroy (0.001031) DELETE FROM roles WHERE "id" = 11 RoleAssignment Load (0.000598) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000496) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000569) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001061) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000448) ROLLBACK SQL (0.000308) BEGIN Product Load (0.000629) SELECT * FROM products WHERE (products."id" = 1) User Load (0.000707) SELECT * FROM users WHERE (users."id" = 5) User Load (0.000615) SELECT * FROM users WHERE (users."id" = 6) SQL (0.000613) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Firm Load (0.000680) SELECT * FROM firms WHERE (firms."id" = 2) Role Load (0.001155) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 Permission Load (0.002501) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 6 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: create Role test role() Role Create (0.001068) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:12.846043', 2, E'test role', 5, '2008-03-03 21:20:12.846043') SQL (0.000403) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) Firm Load (0.000890) SELECT * FROM firms WHERE (firms."id" = 2) SQL (0.001982) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(12) SQL (0.002039) select 'x' from roles where id = 12 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.000866) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:12.870934', 12, 5, NULL, '2008-03-03 21:20:12.870934', NULL) SQL (0.000399) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000627) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001065) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000899) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: offer_for_sale Product tenor saxophone(1) === permission check: edit Role test role(12) SQL (0.002158) select 'x' from roles where id = 12 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001087) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Product', 'f', 'f', '2008-03-03 21:20:12.888514', 1, E'tenor saxophone', 12, NULL, 'f', NULL, '2008-03-03 21:20:12.888514', E'offer_for_sale', NULL) SQL (0.000429) SELECT currval('permissions_id_seq') Permission Load (0.001348) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: offer_for_sale Product tenor saxophone(1) Firm Load (0.000739) SELECT * FROM firms WHERE (firms."id" = 2) SQL (0.001838) select 'x' from products where id = 1 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 5 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'offer_for_sale' or p.privilege = 'any') and (p.class_name = E'Product') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or products.owner_id = 5) and (p.target_owner_id is null or products.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or products.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or products.id = p.target_id) ) === permission check: destroy Role test role(12) Role Destroy (0.000869) DELETE FROM roles WHERE "id" = 12 RoleAssignment Load (0.000550) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000549) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000539) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001037) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) Store Load (0.000566) SELECT * FROM stores WHERE (stores."id" = 2) SQL (0.000550) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Role Load (0.000935) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 === permission check: create Role test role() Role Create (0.001092) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:12.917972', 2, E'test role', 5, '2008-03-03 21:20:12.917972') SQL (0.000497) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) SQL (0.002088) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(13) SQL (0.002077) select 'x' from roles where id = 13 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.000879) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:12.936469', 13, 5, NULL, '2008-03-03 21:20:12.936469', NULL) SQL (0.000412) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000648) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001084) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001493) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: manage_offers Store Ricky's Music Stuff(2) === permission check: edit Role test role(13) SQL (0.002556) select 'x' from roles where id = 13 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.000998) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Store', 'f', 'f', '2008-03-03 21:20:12.954507', 2, E'Ricky''s Music Stuff', 13, NULL, 'f', NULL, '2008-03-03 21:20:12.954507', E'manage_offers', NULL) SQL (0.000459) SELECT currval('permissions_id_seq') Permission Load (0.001445) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: manage_offers Store Ricky's Music Stuff(2) SQL (0.002037) select 'x' from stores where id = 2 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 5 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'manage_offers' or p.privilege = 'any') and (p.class_name = E'Store') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or stores.owner_id = 5) and (p.target_owner_id is null or stores.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or stores.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or stores.id = p.target_id) ) === permission check: destroy Role test role(13) Role Destroy (0.000811) DELETE FROM roles WHERE "id" = 13 RoleAssignment Load (0.000603) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000508) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000516) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001022) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000575) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Role Load (0.000888) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 === permission check: create Role test role() Role Create (0.001076) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:12.980621', 2, E'test role', 5, '2008-03-03 21:20:12.980621') SQL (0.000423) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) SQL (0.002109) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(14) SQL (0.002125) select 'x' from roles where id = 14 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.001069) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:12.999783', 14, 5, NULL, '2008-03-03 21:20:12.999783', NULL) SQL (0.000461) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.001618) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.002657) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.002425) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: manage_offers Store Ricky's Music Stuff(2) === permission check: edit Role test role(14) SQL (0.002011) select 'x' from roles where id = 14 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.000947) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Store', 'f', 'f', '2008-03-03 21:20:13.024378', 2, E'Ricky''s Music Stuff', 14, NULL, 'f', NULL, '2008-03-03 21:20:13.024378', E'manage_offers', NULL) SQL (0.000419) SELECT currval('permissions_id_seq') Permission Load (0.001222) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: manage_offers Store Ricky's Music Stuff(2) === permission check: manage_offers Store Ricky's Music Stuff(2) === permission check: manage_offers Store Ricky's Music Stuff(2) === permission check: manage_offers Store Ricky's Music Stuff(2) === permission check: manage_offers Store Ricky's Music Stuff(2) === permission check: manage_offers Store Ricky's Music Stuff(2) === permission check: manage_offers Store Ricky's Music Stuff(2) === permission check: manage_offers Store Ricky's Music Stuff(2) === permission check: manage_offers Store Ricky's Music Stuff(2) === permission check: manage_offers Store Ricky's Music Stuff(2) === permission check: manage_offers Store Ricky's Music Stuff(2) === permission check: manage_offers Store Ricky's Music Stuff(2) === permission check: manage_offers Store Ricky's Music Stuff(2) === permission check: manage_offers Store Ricky's Music Stuff(2) === permission check: destroy Role test role(14) Role Destroy (0.000982) DELETE FROM roles WHERE "id" = 14 RoleAssignment Load (0.001208) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.001122) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.001204) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.002630) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) User Load (0.001992) SELECT * FROM users WHERE (users."id" = 4) Firm Load (0.000856) SELECT * FROM firms WHERE (firms."id" = 3) PK and serial sequence (0.007386) SELECT attr.attname, seq.relname FROM pg_class seq, pg_attribute attr, pg_depend dep, pg_namespace name, pg_constraint cons WHERE seq.oid = dep.objid AND seq.relkind = 'S' AND attr.attrelid = dep.refobjid AND attr.attnum = dep.refobjsubid AND attr.attrelid = cons.conrelid AND attr.attnum = cons.conkey[1] AND cons.contype = 'p' AND dep.refobjid = 'offers'::regclass Offer Create (0.001454) INSERT INTO offers ("product_id", "owner_firm_id", "discount_pct", "owner_id", "store_id") VALUES(1, 3, 25, 4, 2) SQL (0.000428) SELECT currval('offers_id_seq') SQL (0.000783) ROLLBACK SQL (0.000357) BEGIN User Load (0.001144) SELECT * FROM users WHERE (users."id" = 7) Order Load (0.001318) SELECT * FROM orders WHERE (orders."id" = 1) Permission Load (0.001471) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 7 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: find Order X(1) Offer Load (0.000795) SELECT * FROM offers WHERE (offers."id" = 1) SQL (0.000954) SELECT count(*) AS count_all FROM line_items WHERE (line_items.order_id = 1) LineItem Load (0.001215) SELECT * FROM line_items WHERE (line_items.order_id = 1) Offer Load (0.000773) SELECT * FROM offers WHERE (offers."id" = 2) Offer Load (0.000596) SELECT * FROM offers WHERE (offers."id" = 3) User Load (0.000881) SELECT * FROM users WHERE (users."id" = 5) User Load (0.000705) SELECT * FROM users WHERE (users."id" = 6) SQL (0.000695) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Firm Load (0.000768) SELECT * FROM firms WHERE (firms."id" = 2) Role Load (0.002389) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 Permission Load (0.002084) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 6 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: create Role test role() Role Create (0.000973) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:13.124967', 2, E'test role', 5, '2008-03-03 21:20:13.124967') SQL (0.000415) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) Firm Load (0.000771) SELECT * FROM firms WHERE (firms."id" = 2) SQL (0.001796) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(15) SQL (0.001977) select 'x' from roles where id = 15 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.000843) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:13.148911', 15, 5, NULL, '2008-03-03 21:20:13.148911', NULL) SQL (0.000393) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000647) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001062) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000907) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) LineItem Load (0.000842) SELECT * FROM line_items WHERE (line_items.order_id = 1) AND (line_items."offer_id" = 1) LIMIT 1 === FAILED permission check: edit Order X(1) === permission check: edit Role test role(15) SQL (0.002167) select 'x' from roles where id = 15 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001131) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Order', 'f', 'f', '2008-03-03 21:20:13.170323', 1, NULL, 15, NULL, 'f', NULL, '2008-03-03 21:20:13.170323', E'edit', NULL) SQL (0.000429) SELECT currval('permissions_id_seq') Permission Load (0.001337) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) LineItem Load (0.000728) SELECT * FROM line_items WHERE (line_items.order_id = 1) AND (line_items."offer_id" = 1) LIMIT 1 === permission check: edit Order X(1) Firm Load (0.000850) SELECT * FROM firms WHERE (firms."id" = 2) SQL (0.002242) select 'x' from orders where id = 1 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 5 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Order') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or orders.owner_id = 5) and (p.target_id is null or orders.id = p.target_id) and (p.target_owner_id is null or orders.owner_id = p.target_owner_id) and (p.target_paid is null or orders.paid = p.target_paid) ) === permission check: edit Order X(1) === permission check: edit Order X(1) LineItem Create (0.000924) INSERT INTO line_items ("offer_id", "order_id", "quantity") VALUES(1, 1, 1) SQL (0.000416) SELECT currval('line_items_id_seq') === permission check: destroy Role test role(15) Role Destroy (0.001744) DELETE FROM roles WHERE "id" = 15 RoleAssignment Load (0.001232) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.001296) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.001343) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001470) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) LineItem Load (0.000648) SELECT * FROM line_items WHERE (line_items.order_id = 1) Offer Load (0.000727) SELECT * FROM offers WHERE (offers."id" = 2) Offer Load (0.000745) SELECT * FROM offers WHERE (offers."id" = 3) Offer Load (0.000645) SELECT * FROM offers WHERE (offers."id" = 1) LineItem Load (0.000541) SELECT * FROM line_items WHERE (line_items.order_id = 1) SQL (0.000591) SELECT count(*) AS count_all FROM line_items WHERE (line_items.order_id = 1) SQL (0.000561) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Role Load (0.000959) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 === permission check: create Role test role() Role Create (0.001056) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:13.222974', 2, E'test role', 5, '2008-03-03 21:20:13.222974') SQL (0.000429) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) SQL (0.002527) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(16) SQL (0.004933) select 'x' from roles where id = 16 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.001012) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:13.249261', 16, 5, NULL, '2008-03-03 21:20:13.249261', NULL) SQL (0.000451) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000747) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001174) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001007) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) LineItem Load (0.000644) SELECT * FROM line_items WHERE (line_items.order_id = 1) AND (line_items."offer_id" = 1) LIMIT 1 Order Load (0.000649) SELECT * FROM orders WHERE (orders."id" = 1) === FAILED permission check: find Order X(1) === permission check: edit Role test role(16) SQL (0.002053) select 'x' from roles where id = 16 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001320) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Order', 'f', 'f', '2008-03-03 21:20:13.270525', 1, NULL, 16, NULL, 'f', NULL, '2008-03-03 21:20:13.270525', E'edit', NULL) SQL (0.000397) SELECT currval('permissions_id_seq') Permission Load (0.001255) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) LineItem Load (0.000734) SELECT * FROM line_items WHERE (line_items.order_id = 1) AND (line_items."offer_id" = 1) LIMIT 1 Order Load (0.000801) SELECT * FROM orders WHERE (orders."id" = 1) === FAILED permission check: find Order X(1) Role Load (0.000932) SELECT * FROM roles WHERE (roles."id" = 3) === permission check: edit Role test role(16) === permission check: edit Role twiddler(3) SQL (0.002109) select 'x' from roles where id = 16 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) SQL (0.002102) select 'x' from roles where id = 3 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Update (0.001305) UPDATE permissions SET "created_at" = '2008-03-03 21:20:13.270525', "role_id" = 3, "target_owned_by_self" = 'f', "target_name" = NULL, "has_grant_option" = 'f', "is_grant" = 'f', "class_name" = E'Order', "target_owner_id" = NULL, "privilege" = E'edit', "target_owner_firm_id" = NULL, "target_id" = 1, "updated_at" = '2008-03-03 21:20:13.296990', "target_paid" = NULL WHERE "id" = 614 === permission check: edit Role test role(16) SQL (0.002006) select 'x' from roles where id = 16 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.000892) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Order', 'f', 'f', '2008-03-03 21:20:13.308086', 1, NULL, 16, NULL, 'f', NULL, '2008-03-03 21:20:13.308086', E'find', NULL) SQL (0.000502) SELECT currval('permissions_id_seq') Permission Load (0.001319) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) LineItem Load (0.000801) SELECT * FROM line_items WHERE (line_items.order_id = 1) AND (line_items."offer_id" = 1) LIMIT 1 Order Load (0.000717) SELECT * FROM orders WHERE (orders."id" = 1) === permission check: find Order X(1) === FAILED permission check: edit Order X(1) === permission check: edit Role test role(16) === permission check: edit Role twiddler(3) SQL (0.002106) select 'x' from roles where id = 16 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) SQL (0.002144) select 'x' from roles where id = 3 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Update (0.001021) UPDATE permissions SET "created_at" = '2008-03-03 21:20:13.308086', "role_id" = 3, "target_owned_by_self" = 'f', "target_name" = NULL, "has_grant_option" = 'f', "is_grant" = 'f', "class_name" = E'Order', "target_owner_id" = NULL, "privilege" = E'find', "target_owner_firm_id" = NULL, "target_id" = 1, "updated_at" = '2008-03-03 21:20:13.334615', "target_paid" = NULL WHERE "id" = 615 === permission check: edit Role twiddler(3) === permission check: edit Role test role(16) SQL (0.002124) select 'x' from roles where id = 3 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) SQL (0.002019) select 'x' from roles where id = 16 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Update (0.001231) UPDATE permissions SET "created_at" = '2008-03-03 21:20:13.270525', "role_id" = 16, "target_owned_by_self" = 'f', "target_name" = NULL, "has_grant_option" = 'f', "is_grant" = 'f', "class_name" = E'Order', "target_owner_id" = NULL, "privilege" = E'edit', "target_owner_firm_id" = NULL, "target_id" = 1, "updated_at" = '2008-03-03 21:20:13.349773', "target_paid" = NULL WHERE "id" = 614 === permission check: edit Role twiddler(3) === permission check: edit Role test role(16) SQL (0.002173) select 'x' from roles where id = 3 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) SQL (0.002013) select 'x' from roles where id = 16 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Update (0.001750) UPDATE permissions SET "created_at" = '2008-03-03 21:20:13.308086', "role_id" = 16, "target_owned_by_self" = 'f', "target_name" = NULL, "has_grant_option" = 'f', "is_grant" = 'f', "class_name" = E'Order', "target_owner_id" = NULL, "privilege" = E'find', "target_owner_firm_id" = NULL, "target_id" = 1, "updated_at" = '2008-03-03 21:20:13.365050', "target_paid" = NULL WHERE "id" = 615 Permission Load (0.003031) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) LineItem Load (0.000708) SELECT * FROM line_items WHERE (line_items.order_id = 1) AND (line_items."offer_id" = 1) LIMIT 1 Order Load (0.000633) SELECT * FROM orders WHERE (orders."id" = 1) === permission check: find Order X(1) === permission check: edit Order X(1) === permission check: edit Order X(1) Offer Load (0.000752) SELECT * FROM offers WHERE (offers."id" = 1) LineItem Update (0.001212) UPDATE line_items SET "order_id" = 1, "offer_id" = 1, "quantity" = 2 WHERE "id" = 4 === permission check: destroy Role test role(16) Role Destroy (0.000736) DELETE FROM roles WHERE "id" = 16 RoleAssignment Load (0.000563) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000487) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000561) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001711) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) LineItem Load (0.000664) SELECT * FROM line_items WHERE (line_items.order_id = 1) LineItem Load (0.000696) SELECT * FROM line_items WHERE (line_items."id" = 4) SQL (0.000642) SELECT count(*) AS count_all FROM line_items WHERE (line_items.order_id = 1) SQL (0.000527) ROLLBACK SQL (0.000390) BEGIN User Load (0.000838) SELECT * FROM users WHERE (users."id" = 7) Order Load (0.000690) SELECT * FROM orders WHERE (orders."id" = 1) Permission Load (0.002045) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 7 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: find Order X(1) User Load (0.001489) SELECT * FROM users WHERE (users."id" = 5) User Load (0.000851) SELECT * FROM users WHERE (users."id" = 6) SQL (0.000581) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Firm Load (0.001407) SELECT * FROM firms WHERE (firms."id" = 2) Role Load (0.001064) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 Permission Load (0.001406) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 6 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: create Role test role() Role Create (0.000972) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:13.427515', 2, E'test role', 5, '2008-03-03 21:20:13.427515') SQL (0.000404) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) Firm Load (0.000916) SELECT * FROM firms WHERE (firms."id" = 2) SQL (0.001924) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(17) SQL (0.001970) select 'x' from roles where id = 17 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.000843) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:13.450561', 17, 5, NULL, '2008-03-03 21:20:13.450561', NULL) SQL (0.000398) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.001284) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001059) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001039) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) LineItem Load (0.000746) SELECT * FROM line_items WHERE (line_items."id" = 1) LineItem Load (0.000615) SELECT * FROM line_items WHERE (line_items."id" = 2) === FAILED permission check: administer Order X(1) === permission check: edit Role test role(17) SQL (0.002143) select 'x' from roles where id = 17 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001072) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Order', 'f', 'f', '2008-03-03 21:20:13.472976', 1, NULL, 17, NULL, 'f', NULL, '2008-03-03 21:20:13.472976', E'edit', NULL) SQL (0.000465) SELECT currval('permissions_id_seq') Permission Load (0.003306) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === FAILED permission check: administer Order X(1) Role Load (0.001927) SELECT * FROM roles WHERE (roles."id" = 3) === permission check: edit Role test role(17) === permission check: edit Role twiddler(3) SQL (0.002005) select 'x' from roles where id = 17 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) SQL (0.001774) select 'x' from roles where id = 3 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Update (0.001122) UPDATE permissions SET "created_at" = '2008-03-03 21:20:13.472976', "role_id" = 3, "target_owned_by_self" = 'f', "target_name" = NULL, "has_grant_option" = 'f', "is_grant" = 'f', "class_name" = E'Order', "target_owner_id" = NULL, "privilege" = E'edit', "target_owner_firm_id" = NULL, "target_id" = 1, "updated_at" = '2008-03-03 21:20:13.506448', "target_paid" = NULL WHERE "id" = 616 === permission check: edit Role test role(17) SQL (0.002163) select 'x' from roles where id = 17 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001010) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Order', 'f', 'f', '2008-03-03 21:20:13.517395', 1, NULL, 17, NULL, 'f', NULL, '2008-03-03 21:20:13.517395', E'find', NULL) SQL (0.000432) SELECT currval('permissions_id_seq') Permission Load (0.001404) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === FAILED permission check: administer Order X(1) === permission check: edit Role test role(17) === permission check: edit Role twiddler(3) SQL (0.002122) select 'x' from roles where id = 17 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) SQL (0.001734) select 'x' from roles where id = 3 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Update (0.002035) UPDATE permissions SET "created_at" = '2008-03-03 21:20:13.517395', "role_id" = 3, "target_owned_by_self" = 'f', "target_name" = NULL, "has_grant_option" = 'f', "is_grant" = 'f', "class_name" = E'Order', "target_owner_id" = NULL, "privilege" = E'find', "target_owner_firm_id" = NULL, "target_id" = 1, "updated_at" = '2008-03-03 21:20:13.537118', "target_paid" = NULL WHERE "id" = 617 === permission check: edit Role test role(17) SQL (0.002007) select 'x' from roles where id = 17 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001091) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Order', 'f', 'f', '2008-03-03 21:20:13.550117', 1, NULL, 17, NULL, 'f', NULL, '2008-03-03 21:20:13.550117', E'administer', NULL) SQL (0.000461) SELECT currval('permissions_id_seq') Permission Load (0.001403) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: administer Order X(1) === permission check: administer Order X(1) LineItem Load (0.001273) SELECT * FROM line_items WHERE (line_items.order_id = 1) Order Load (0.000717) SELECT * FROM orders WHERE (orders."id" = 1) === FAILED permission check: find Order X(1) === permission check: edit Role test role(17) === permission check: edit Role twiddler(3) SQL (0.002042) select 'x' from roles where id = 17 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) SQL (0.001746) select 'x' from roles where id = 3 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Update (0.001228) UPDATE permissions SET "created_at" = '2008-03-03 21:20:13.550117', "role_id" = 3, "target_owned_by_self" = 'f', "target_name" = NULL, "has_grant_option" = 'f', "is_grant" = 'f', "class_name" = E'Order', "target_owner_id" = NULL, "privilege" = E'administer', "target_owner_firm_id" = NULL, "target_id" = 1, "updated_at" = '2008-03-03 21:20:13.576862', "target_paid" = NULL WHERE "id" = 618 === permission check: edit Role twiddler(3) === permission check: edit Role test role(17) SQL (0.002316) select 'x' from roles where id = 3 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) SQL (0.001943) select 'x' from roles where id = 17 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Update (0.002164) UPDATE permissions SET "created_at" = '2008-03-03 21:20:13.472976', "role_id" = 17, "target_owned_by_self" = 'f', "target_name" = NULL, "has_grant_option" = 'f', "is_grant" = 'f', "class_name" = E'Order', "target_owner_id" = NULL, "privilege" = E'edit', "target_owner_firm_id" = NULL, "target_id" = 1, "updated_at" = '2008-03-03 21:20:13.592625', "target_paid" = NULL WHERE "id" = 616 === permission check: edit Role twiddler(3) === permission check: edit Role test role(17) SQL (0.002093) select 'x' from roles where id = 3 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) SQL (0.001968) select 'x' from roles where id = 17 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Update (0.001016) UPDATE permissions SET "created_at" = '2008-03-03 21:20:13.517395', "role_id" = 17, "target_owned_by_self" = 'f', "target_name" = NULL, "has_grant_option" = 'f', "is_grant" = 'f', "class_name" = E'Order', "target_owner_id" = NULL, "privilege" = E'find', "target_owner_firm_id" = NULL, "target_id" = 1, "updated_at" = '2008-03-03 21:20:13.615305', "target_paid" = NULL WHERE "id" = 617 === permission check: edit Role twiddler(3) === permission check: edit Role test role(17) SQL (0.001955) select 'x' from roles where id = 3 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) SQL (0.001819) select 'x' from roles where id = 17 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Update (0.001167) UPDATE permissions SET "created_at" = '2008-03-03 21:20:13.550117', "role_id" = 17, "target_owned_by_self" = 'f', "target_name" = NULL, "has_grant_option" = 'f', "is_grant" = 'f', "class_name" = E'Order', "target_owner_id" = NULL, "privilege" = E'administer', "target_owner_firm_id" = NULL, "target_id" = 1, "updated_at" = '2008-03-03 21:20:13.629499', "target_paid" = NULL WHERE "id" = 618 Permission Load (0.001453) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) Order Load (0.000974) SELECT * FROM orders WHERE (orders."id" = 1) === permission check: find Order X(1) === permission check: edit Order X(1) === permission check: edit Order X(1) Order Load (0.000900) SELECT * FROM orders WHERE (orders."id" = 1) === permission check: find Order X(1) === permission check: edit Order X(1) === permission check: edit Order X(1) Offer Load (0.000856) SELECT * FROM offers WHERE (offers."id" = 2) User Load (0.000740) SELECT * FROM users WHERE (users."id" = 3) Firm Load (0.000646) SELECT * FROM firms WHERE (firms."id" = 3) === permission check: destroy Role test role(17) Role Destroy (0.000832) DELETE FROM roles WHERE "id" = 17 RoleAssignment Load (0.001420) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.001131) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.001227) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001596) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000683) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Role Load (0.001146) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 === permission check: create Role test role() Role Create (0.001039) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:13.677857', 2, E'test role', 5, '2008-03-03 21:20:13.677857') SQL (0.000417) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) SQL (0.002180) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(18) SQL (0.001983) select 'x' from roles where id = 18 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.000948) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:13.695986', 18, 5, NULL, '2008-03-03 21:20:13.695986', NULL) SQL (0.000433) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000776) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001284) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001100) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) Order Load (0.000780) SELECT * FROM orders WHERE (orders."id" = 1) === FAILED permission check: find Order X(1) === permission check: edit Role test role(18) SQL (0.002229) select 'x' from roles where id = 18 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.000974) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Order', 'f', 'f', '2008-03-03 21:20:13.716061', 1, NULL, 18, NULL, 'f', NULL, '2008-03-03 21:20:13.716061', E'find', NULL) SQL (0.000408) SELECT currval('permissions_id_seq') Permission Load (0.001756) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) Order Load (0.000686) SELECT * FROM orders WHERE (orders."id" = 1) === permission check: find Order X(1) LineItem Load (0.000554) SELECT * FROM line_items WHERE (line_items."id" = 1) LineItem Load (0.000583) SELECT * FROM line_items WHERE (line_items."id" = 2) === permission check: destroy Role test role(18) Role Destroy (0.001164) DELETE FROM roles WHERE "id" = 18 RoleAssignment Load (0.001249) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.001193) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.001464) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.002638) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001160) ROLLBACK SQL (0.000841) BEGIN User Load (0.001037) SELECT * FROM users WHERE (users."id" = 7) Order Load (0.000798) SELECT * FROM orders WHERE (orders."id" = 1) Permission Load (0.001362) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 7 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: find Order X(1) User Load (0.000949) SELECT * FROM users WHERE (users."id" = 5) User Load (0.001153) SELECT * FROM users WHERE (users."id" = 6) SQL (0.002900) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Firm Load (0.000948) SELECT * FROM firms WHERE (firms."id" = 2) Role Load (0.001099) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 Permission Load (0.001630) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 6 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: create Role test role() Role Create (0.001031) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:13.907266', 2, E'test role', 5, '2008-03-03 21:20:13.907266') SQL (0.000433) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) Firm Load (0.000827) SELECT * FROM firms WHERE (firms."id" = 2) SQL (0.002352) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(19) SQL (0.002032) select 'x' from roles where id = 19 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.001004) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:13.932218', 19, 5, NULL, '2008-03-03 21:20:13.932218', NULL) SQL (0.000432) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000797) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001080) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001039) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: place Order X(1) === permission check: edit Role test role(19) SQL (0.002764) select 'x' from roles where id = 19 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001076) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Order', 'f', 'f', '2008-03-03 21:20:13.951311', 1, NULL, 19, NULL, 'f', NULL, '2008-03-03 21:20:13.951311', E'place', NULL) SQL (0.000437) SELECT currval('permissions_id_seq') Permission Load (0.001451) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: place Order X(1) === permission check: place Order X(1) User Load (0.000881) SELECT * FROM users WHERE (users."id" = 3) Firm Load (0.000629) SELECT * FROM firms WHERE (firms."id" = 3) === permission check: destroy Role test role(19) Role Destroy (0.000843) DELETE FROM roles WHERE "id" = 19 RoleAssignment Load (0.000611) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000511) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000667) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001182) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001384) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Role Load (0.001125) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 === permission check: create Role test role() Role Create (0.001142) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:13.987629', 2, E'test role', 5, '2008-03-03 21:20:13.987629') SQL (0.000419) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) SQL (0.001913) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(20) SQL (0.002530) select 'x' from roles where id = 20 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.000993) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:14.007233', 20, 5, NULL, '2008-03-03 21:20:14.007233', NULL) SQL (0.000429) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000831) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001160) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001303) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) LineItem Load (0.000615) SELECT * FROM line_items WHERE (line_items."id" = 1) LineItem Load (0.000495) SELECT * FROM line_items WHERE (line_items."id" = 2) === FAILED permission check: place Order X(1) === permission check: edit Role test role(20) SQL (0.004413) select 'x' from roles where id = 20 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.002474) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Order', 'f', 'f', '2008-03-03 21:20:14.035096', 1, NULL, 20, NULL, 'f', NULL, '2008-03-03 21:20:14.035096', E'edit', NULL) SQL (0.000486) SELECT currval('permissions_id_seq') Permission Load (0.001361) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === FAILED permission check: place Order X(1) Role Load (0.000842) SELECT * FROM roles WHERE (roles."id" = 3) === permission check: edit Role test role(20) === permission check: edit Role twiddler(3) SQL (0.002040) select 'x' from roles where id = 20 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) SQL (0.002035) select 'x' from roles where id = 3 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Update (0.001264) UPDATE permissions SET "created_at" = '2008-03-03 21:20:14.035096', "role_id" = 3, "target_owned_by_self" = 'f', "target_name" = NULL, "has_grant_option" = 'f', "is_grant" = 'f', "class_name" = E'Order', "target_owner_id" = NULL, "privilege" = E'edit', "target_owner_firm_id" = NULL, "target_id" = 1, "updated_at" = '2008-03-03 21:20:14.062895', "target_paid" = NULL WHERE "id" = 621 === permission check: edit Role test role(20) SQL (0.002135) select 'x' from roles where id = 20 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001004) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Order', 'f', 'f', '2008-03-03 21:20:14.074349', 1, NULL, 20, NULL, 'f', NULL, '2008-03-03 21:20:14.074349', E'find', NULL) SQL (0.000444) SELECT currval('permissions_id_seq') Permission Load (0.001301) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === FAILED permission check: place Order X(1) === permission check: edit Role test role(20) === permission check: edit Role twiddler(3) SQL (0.002315) select 'x' from roles where id = 20 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) SQL (0.001803) select 'x' from roles where id = 3 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Update (0.001097) UPDATE permissions SET "created_at" = '2008-03-03 21:20:14.074349', "role_id" = 3, "target_owned_by_self" = 'f', "target_name" = NULL, "has_grant_option" = 'f', "is_grant" = 'f', "class_name" = E'Order', "target_owner_id" = NULL, "privilege" = E'find', "target_owner_firm_id" = NULL, "target_id" = 1, "updated_at" = '2008-03-03 21:20:14.097755', "target_paid" = NULL WHERE "id" = 622 === permission check: edit Role test role(20) SQL (0.002301) select 'x' from roles where id = 20 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001066) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Order', 'f', 'f', '2008-03-03 21:20:14.108739', 1, NULL, 20, NULL, 'f', NULL, '2008-03-03 21:20:14.108739', E'place', NULL) SQL (0.000471) SELECT currval('permissions_id_seq') Permission Load (0.001418) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: place Order X(1) === permission check: place Order X(1) LineItem Load (0.000848) SELECT * FROM line_items WHERE (line_items.order_id = 1) Order Load (0.000889) SELECT * FROM orders WHERE (orders."id" = 1) === FAILED permission check: find Order X(1) === permission check: edit Role test role(20) === permission check: edit Role twiddler(3) SQL (0.002085) select 'x' from roles where id = 20 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) SQL (0.001746) select 'x' from roles where id = 3 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Update (0.001200) UPDATE permissions SET "created_at" = '2008-03-03 21:20:14.108739', "role_id" = 3, "target_owned_by_self" = 'f', "target_name" = NULL, "has_grant_option" = 'f', "is_grant" = 'f', "class_name" = E'Order', "target_owner_id" = NULL, "privilege" = E'place', "target_owner_firm_id" = NULL, "target_id" = 1, "updated_at" = '2008-03-03 21:20:14.136214', "target_paid" = NULL WHERE "id" = 623 === permission check: edit Role twiddler(3) === permission check: edit Role test role(20) SQL (0.004358) select 'x' from roles where id = 3 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) SQL (0.004439) select 'x' from roles where id = 20 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Update (0.001277) UPDATE permissions SET "created_at" = '2008-03-03 21:20:14.035096', "role_id" = 20, "target_owned_by_self" = 'f', "target_name" = NULL, "has_grant_option" = 'f', "is_grant" = 'f', "class_name" = E'Order', "target_owner_id" = NULL, "privilege" = E'edit', "target_owner_firm_id" = NULL, "target_id" = 1, "updated_at" = '2008-03-03 21:20:14.159251', "target_paid" = NULL WHERE "id" = 621 === permission check: edit Role twiddler(3) === permission check: edit Role test role(20) SQL (0.002060) select 'x' from roles where id = 3 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) SQL (0.001803) select 'x' from roles where id = 20 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Update (0.001172) UPDATE permissions SET "created_at" = '2008-03-03 21:20:14.074349', "role_id" = 20, "target_owned_by_self" = 'f', "target_name" = NULL, "has_grant_option" = 'f', "is_grant" = 'f', "class_name" = E'Order', "target_owner_id" = NULL, "privilege" = E'find', "target_owner_firm_id" = NULL, "target_id" = 1, "updated_at" = '2008-03-03 21:20:14.174279', "target_paid" = NULL WHERE "id" = 622 === permission check: edit Role twiddler(3) === permission check: edit Role test role(20) SQL (0.005518) select 'x' from roles where id = 3 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) SQL (0.002633) select 'x' from roles where id = 20 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Update (0.001231) UPDATE permissions SET "created_at" = '2008-03-03 21:20:14.108739', "role_id" = 20, "target_owned_by_self" = 'f', "target_name" = NULL, "has_grant_option" = 'f', "is_grant" = 'f', "class_name" = E'Order', "target_owner_id" = NULL, "privilege" = E'place', "target_owner_firm_id" = NULL, "target_id" = 1, "updated_at" = '2008-03-03 21:20:14.195280', "target_paid" = NULL WHERE "id" = 623 Permission Load (0.001379) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) Order Load (0.000822) SELECT * FROM orders WHERE (orders."id" = 1) === permission check: find Order X(1) === permission check: edit Order X(1) === permission check: edit Order X(1) Order Load (0.000780) SELECT * FROM orders WHERE (orders."id" = 1) === permission check: find Order X(1) === permission check: edit Order X(1) === permission check: edit Order X(1) Offer Load (0.000767) SELECT * FROM offers WHERE (offers."id" = 2) Offer Load (0.000578) SELECT * FROM offers WHERE (offers."id" = 3) === permission check: destroy Role test role(20) Role Destroy (0.000920) DELETE FROM roles WHERE "id" = 20 RoleAssignment Load (0.000646) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000545) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000563) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001043) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000569) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Role Load (0.001012) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 === permission check: create Role test role() Role Create (0.001091) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:14.235988', 2, E'test role', 5, '2008-03-03 21:20:14.235988') SQL (0.000458) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) SQL (0.002102) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(21) SQL (0.002132) select 'x' from roles where id = 21 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.002056) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:14.254780', 21, 5, NULL, '2008-03-03 21:20:14.254780', NULL) SQL (0.000925) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.001603) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001961) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000912) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) Order Load (0.000678) SELECT * FROM orders WHERE (orders."id" = 1) === FAILED permission check: find Order X(1) === permission check: edit Role test role(21) SQL (0.002106) select 'x' from roles where id = 21 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.000993) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Order', 'f', 'f', '2008-03-03 21:20:14.280032', 1, NULL, 21, NULL, 'f', NULL, '2008-03-03 21:20:14.280032', E'find', NULL) SQL (0.000404) SELECT currval('permissions_id_seq') Permission Load (0.001392) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) Order Load (0.000715) SELECT * FROM orders WHERE (orders."id" = 1) === permission check: find Order X(1) LineItem Load (0.001165) SELECT * FROM line_items WHERE (line_items."id" = 1) LineItem Load (0.001199) SELECT * FROM line_items WHERE (line_items."id" = 2) === permission check: destroy Role test role(21) Role Destroy (0.000823) DELETE FROM roles WHERE "id" = 21 RoleAssignment Load (0.000653) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000541) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000583) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001227) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000498) ROLLBACK SQL (0.000357) BEGIN User Load (0.000845) SELECT * FROM users WHERE (users."id" = 7) Order Load (0.000731) SELECT * FROM orders WHERE (orders."id" = 1) Permission Load (0.001324) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 7 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: find Order X(1) User Load (0.001882) SELECT * FROM users WHERE (users."id" = 5) User Load (0.000854) SELECT * FROM users WHERE (users."id" = 6) SQL (0.000641) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Firm Load (0.001566) SELECT * FROM firms WHERE (firms."id" = 2) Role Load (0.002564) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 Permission Load (0.001727) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 6 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: create Role test role() Role Create (0.000987) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:14.336206', 2, E'test role', 5, '2008-03-03 21:20:14.336206') SQL (0.000419) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) Firm Load (0.000888) SELECT * FROM firms WHERE (firms."id" = 2) SQL (0.001981) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(22) SQL (0.002163) select 'x' from roles where id = 22 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.002308) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:14.360924', 22, 5, NULL, '2008-03-03 21:20:14.360924', NULL) SQL (0.001184) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000713) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001202) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001053) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) LineItem Load (0.000644) SELECT * FROM line_items WHERE (line_items."id" = 1) LineItem Load (0.000487) SELECT * FROM line_items WHERE (line_items."id" = 2) === FAILED permission check: administer Order X(1) === permission check: edit Role test role(22) SQL (0.002670) select 'x' from roles where id = 22 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001047) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Order', 'f', 'f', '2008-03-03 21:20:14.386326', 1, NULL, 22, NULL, 'f', NULL, '2008-03-03 21:20:14.386326', E'edit', NULL) SQL (0.000483) SELECT currval('permissions_id_seq') Permission Load (0.001775) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === FAILED permission check: administer Order X(1) Role Load (0.000775) SELECT * FROM roles WHERE (roles."id" = 3) === permission check: edit Role test role(22) === permission check: edit Role twiddler(3) SQL (0.002081) select 'x' from roles where id = 22 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) SQL (0.001776) select 'x' from roles where id = 3 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Update (0.001108) UPDATE permissions SET "created_at" = '2008-03-03 21:20:14.386326', "role_id" = 3, "target_owned_by_self" = 'f', "target_name" = NULL, "has_grant_option" = 'f', "is_grant" = 'f', "class_name" = E'Order', "target_owner_id" = NULL, "privilege" = E'edit', "target_owner_firm_id" = NULL, "target_id" = 1, "updated_at" = '2008-03-03 21:20:14.408015', "target_paid" = NULL WHERE "id" = 625 === permission check: edit Role test role(22) SQL (0.001860) select 'x' from roles where id = 22 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001003) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Order', 'f', 'f', '2008-03-03 21:20:14.418132', 1, NULL, 22, NULL, 'f', NULL, '2008-03-03 21:20:14.418132', E'find', NULL) SQL (0.000508) SELECT currval('permissions_id_seq') Permission Load (0.001381) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === FAILED permission check: administer Order X(1) === permission check: edit Role test role(22) === permission check: edit Role twiddler(3) SQL (0.002262) select 'x' from roles where id = 22 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) SQL (0.001947) select 'x' from roles where id = 3 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Update (0.001172) UPDATE permissions SET "created_at" = '2008-03-03 21:20:14.418132', "role_id" = 3, "target_owned_by_self" = 'f', "target_name" = NULL, "has_grant_option" = 'f', "is_grant" = 'f', "class_name" = E'Order', "target_owner_id" = NULL, "privilege" = E'find', "target_owner_firm_id" = NULL, "target_id" = 1, "updated_at" = '2008-03-03 21:20:14.438185', "target_paid" = NULL WHERE "id" = 626 === permission check: edit Role test role(22) SQL (0.001945) select 'x' from roles where id = 22 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001014) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Order', 'f', 'f', '2008-03-03 21:20:14.448820', 1, NULL, 22, NULL, 'f', NULL, '2008-03-03 21:20:14.448820', E'administer', NULL) SQL (0.000459) SELECT currval('permissions_id_seq') Permission Load (0.001393) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: administer Order X(1) === permission check: administer Order X(1) LineItem Load (0.000770) SELECT * FROM line_items WHERE (line_items.order_id = 1) Order Load (0.001127) SELECT * FROM orders WHERE (orders."id" = 1) === FAILED permission check: find Order X(1) === permission check: edit Role test role(22) === permission check: edit Role twiddler(3) SQL (0.002215) select 'x' from roles where id = 22 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) SQL (0.001796) select 'x' from roles where id = 3 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Update (0.001086) UPDATE permissions SET "created_at" = '2008-03-03 21:20:14.448820', "role_id" = 3, "target_owned_by_self" = 'f', "target_name" = NULL, "has_grant_option" = 'f', "is_grant" = 'f', "class_name" = E'Order', "target_owner_id" = NULL, "privilege" = E'administer', "target_owner_firm_id" = NULL, "target_id" = 1, "updated_at" = '2008-03-03 21:20:14.483744', "target_paid" = NULL WHERE "id" = 627 === permission check: edit Role twiddler(3) === permission check: edit Role test role(22) SQL (0.002084) select 'x' from roles where id = 3 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) SQL (0.001995) select 'x' from roles where id = 22 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Update (0.001292) UPDATE permissions SET "created_at" = '2008-03-03 21:20:14.386326', "role_id" = 22, "target_owned_by_self" = 'f', "target_name" = NULL, "has_grant_option" = 'f', "is_grant" = 'f', "class_name" = E'Order', "target_owner_id" = NULL, "privilege" = E'edit', "target_owner_firm_id" = NULL, "target_id" = 1, "updated_at" = '2008-03-03 21:20:14.498786', "target_paid" = NULL WHERE "id" = 625 === permission check: edit Role twiddler(3) === permission check: edit Role test role(22) SQL (0.002269) select 'x' from roles where id = 3 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) SQL (0.001975) select 'x' from roles where id = 22 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Update (0.002537) UPDATE permissions SET "created_at" = '2008-03-03 21:20:14.418132', "role_id" = 22, "target_owned_by_self" = 'f', "target_name" = NULL, "has_grant_option" = 'f', "is_grant" = 'f', "class_name" = E'Order', "target_owner_id" = NULL, "privilege" = E'find', "target_owner_firm_id" = NULL, "target_id" = 1, "updated_at" = '2008-03-03 21:20:14.515588', "target_paid" = NULL WHERE "id" = 626 === permission check: edit Role twiddler(3) === permission check: edit Role test role(22) SQL (0.002018) select 'x' from roles where id = 3 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) SQL (0.001742) select 'x' from roles where id = 22 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Update (0.175113) UPDATE permissions SET "created_at" = '2008-03-03 21:20:14.448820', "role_id" = 22, "target_owned_by_self" = 'f', "target_name" = NULL, "has_grant_option" = 'f', "is_grant" = 'f', "class_name" = E'Order', "target_owner_id" = NULL, "privilege" = E'administer', "target_owner_firm_id" = NULL, "target_id" = 1, "updated_at" = '2008-03-03 21:20:14.533759', "target_paid" = NULL WHERE "id" = 627 Permission Load (0.002125) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) Order Load (0.000759) SELECT * FROM orders WHERE (orders."id" = 1) === permission check: find Order X(1) === permission check: edit Order X(1) === permission check: edit Order X(1) Order Load (0.000834) SELECT * FROM orders WHERE (orders."id" = 1) === permission check: find Order X(1) === permission check: edit Order X(1) === permission check: edit Order X(1) Offer Load (0.000877) SELECT * FROM offers WHERE (offers."id" = 2) Offer Load (0.000571) SELECT * FROM offers WHERE (offers."id" = 3) User Load (0.000794) SELECT * FROM users WHERE (users."id" = 3) Firm Load (0.000620) SELECT * FROM firms WHERE (firms."id" = 3) Order Update (0.001280) UPDATE orders SET "created_at" = '2006-10-31 00:00:00.000000', "owner_firm_id" = 3, "payment_authenticator" = NULL, "owner_id" = 3, "store_id" = 2, "shipping_address" = E'3 shady grove', "notes" = E'drizzle drizzle', "paid" = 'f', "updated_at" = '2008-03-03 21:20:14.739571', "shipped" = 'f' WHERE "id" = 1 LineItem Update (0.000858) UPDATE line_items SET "order_id" = 1, "offer_id" = 2, "quantity" = 53 WHERE "id" = 1 === permission check: edit Order X(1) LineItem Destroy (0.000765) DELETE FROM line_items WHERE "id" = 2 Order Load (0.000844) SELECT * FROM orders WHERE (orders."id" = 1) === permission check: find Order X(1) === permission check: destroy Role test role(22) Role Destroy (0.001014) DELETE FROM roles WHERE "id" = 22 RoleAssignment Load (0.000602) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000593) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000633) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001078) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) LineItem Load (0.000577) SELECT * FROM line_items WHERE (line_items."id" = 1) LineItem Load (0.000604) SELECT * FROM line_items WHERE (line_items."id" = 2) LIMIT 1 SQL (0.000614) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Role Load (0.001107) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 === permission check: create Role test role() Role Create (0.000987) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:14.769635', 2, E'test role', 5, '2008-03-03 21:20:14.769635') SQL (0.000400) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) SQL (0.002086) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(23) SQL (0.001999) select 'x' from roles where id = 23 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.000900) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:14.787599', 23, 5, NULL, '2008-03-03 21:20:14.787599', NULL) SQL (0.000471) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000757) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001067) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000918) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: administer Order X(1) === permission check: edit Role test role(23) SQL (0.002135) select 'x' from roles where id = 23 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001115) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Order', 'f', 'f', '2008-03-03 21:20:14.805937', 1, NULL, 23, NULL, 'f', NULL, '2008-03-03 21:20:14.805937', E'edit', NULL) SQL (0.000438) SELECT currval('permissions_id_seq') Permission Load (0.001361) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === FAILED permission check: administer Order X(1) === permission check: edit Role test role(23) === permission check: edit Role twiddler(3) SQL (0.002151) select 'x' from roles where id = 23 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) SQL (0.001806) select 'x' from roles where id = 3 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Update (0.001170) UPDATE permissions SET "created_at" = '2008-03-03 21:20:14.805937', "role_id" = 3, "target_owned_by_self" = 'f', "target_name" = NULL, "has_grant_option" = 'f', "is_grant" = 'f', "class_name" = E'Order', "target_owner_id" = NULL, "privilege" = E'edit', "target_owner_firm_id" = NULL, "target_id" = 1, "updated_at" = '2008-03-03 21:20:14.825586', "target_paid" = NULL WHERE "id" = 628 === permission check: edit Role test role(23) SQL (0.002003) select 'x' from roles where id = 23 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001032) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Order', 'f', 'f', '2008-03-03 21:20:14.836029', 1, NULL, 23, NULL, 'f', NULL, '2008-03-03 21:20:14.836029', E'find', NULL) SQL (0.000568) SELECT currval('permissions_id_seq') Permission Load (0.001247) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === FAILED permission check: administer Order X(1) === permission check: edit Role test role(23) === permission check: edit Role twiddler(3) SQL (0.001459) select 'x' from roles where id = 23 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) SQL (0.001297) select 'x' from roles where id = 3 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Update (0.000692) UPDATE permissions SET "created_at" = '2008-03-03 21:20:14.836029', "role_id" = 3, "target_owned_by_self" = 'f', "target_name" = NULL, "has_grant_option" = 'f', "is_grant" = 'f', "class_name" = E'Order', "target_owner_id" = NULL, "privilege" = E'find', "target_owner_firm_id" = NULL, "target_id" = 1, "updated_at" = '2008-03-03 21:20:14.853266', "target_paid" = NULL WHERE "id" = 629 === permission check: edit Role test role(23) SQL (0.001961) select 'x' from roles where id = 23 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.000901) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Order', 'f', 'f', '2008-03-03 21:20:14.861872', 1, NULL, 23, NULL, 'f', NULL, '2008-03-03 21:20:14.861872', E'administer', NULL) SQL (0.000401) SELECT currval('permissions_id_seq') Permission Load (0.001253) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: administer Order X(1) === permission check: administer Order X(1) LineItem Load (0.000755) SELECT * FROM line_items WHERE (line_items.order_id = 1) Order Load (0.000810) SELECT * FROM orders WHERE (orders."id" = 1) === FAILED permission check: find Order X(1) === permission check: edit Role test role(23) === permission check: edit Role twiddler(3) SQL (0.002211) select 'x' from roles where id = 23 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) SQL (0.002668) select 'x' from roles where id = 3 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Update (0.001186) UPDATE permissions SET "created_at" = '2008-03-03 21:20:14.861872', "role_id" = 3, "target_owned_by_self" = 'f', "target_name" = NULL, "has_grant_option" = 'f', "is_grant" = 'f', "class_name" = E'Order', "target_owner_id" = NULL, "privilege" = E'administer', "target_owner_firm_id" = NULL, "target_id" = 1, "updated_at" = '2008-03-03 21:20:14.888185', "target_paid" = NULL WHERE "id" = 630 === permission check: edit Role twiddler(3) === permission check: edit Role test role(23) SQL (0.001907) select 'x' from roles where id = 3 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) SQL (0.001773) select 'x' from roles where id = 23 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Update (0.001098) UPDATE permissions SET "created_at" = '2008-03-03 21:20:14.805937', "role_id" = 23, "target_owned_by_self" = 'f', "target_name" = NULL, "has_grant_option" = 'f', "is_grant" = 'f', "class_name" = E'Order', "target_owner_id" = NULL, "privilege" = E'edit', "target_owner_firm_id" = NULL, "target_id" = 1, "updated_at" = '2008-03-03 21:20:14.902817', "target_paid" = NULL WHERE "id" = 628 === permission check: edit Role twiddler(3) === permission check: edit Role test role(23) SQL (0.001938) select 'x' from roles where id = 3 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) SQL (0.001828) select 'x' from roles where id = 23 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Update (0.001224) UPDATE permissions SET "created_at" = '2008-03-03 21:20:14.836029', "role_id" = 23, "target_owned_by_self" = 'f', "target_name" = NULL, "has_grant_option" = 'f', "is_grant" = 'f', "class_name" = E'Order', "target_owner_id" = NULL, "privilege" = E'find', "target_owner_firm_id" = NULL, "target_id" = 1, "updated_at" = '2008-03-03 21:20:14.917081', "target_paid" = NULL WHERE "id" = 629 === permission check: edit Role twiddler(3) === permission check: edit Role test role(23) SQL (0.002047) select 'x' from roles where id = 3 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) SQL (0.001947) select 'x' from roles where id = 23 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Update (0.001204) UPDATE permissions SET "created_at" = '2008-03-03 21:20:14.861872', "role_id" = 23, "target_owned_by_self" = 'f', "target_name" = NULL, "has_grant_option" = 'f', "is_grant" = 'f', "class_name" = E'Order', "target_owner_id" = NULL, "privilege" = E'administer', "target_owner_firm_id" = NULL, "target_id" = 1, "updated_at" = '2008-03-03 21:20:14.931996', "target_paid" = NULL WHERE "id" = 630 Permission Load (0.001502) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) Order Load (0.000848) SELECT * FROM orders WHERE (orders."id" = 1) === permission check: find Order X(1) === permission check: edit Order X(1) === permission check: edit Order X(1) Offer Load (0.000782) SELECT * FROM offers WHERE (offers."id" = 2) User Load (0.000679) SELECT * FROM users WHERE (users."id" = 3) Firm Load (0.000663) SELECT * FROM firms WHERE (firms."id" = 3) Order Update (0.001953) UPDATE orders SET "created_at" = '2006-10-31 00:00:00.000000', "owner_firm_id" = 3, "payment_authenticator" = NULL, "owner_id" = 3, "store_id" = 2, "shipping_address" = E'3 shady grove', "notes" = E'rain rain', "paid" = 'f', "updated_at" = '2008-03-03 21:20:14.952438', "shipped" = 'f' WHERE "id" = 1 === permission check: edit Order X(1) LineItem Destroy (0.000734) DELETE FROM line_items WHERE "id" = 1 Order Load (0.000681) SELECT * FROM orders WHERE (orders."id" = 1) === permission check: find Order X(1) LineItem Load (0.000724) SELECT * FROM line_items WHERE (line_items."id" = 1) LIMIT 1 === permission check: destroy Role test role(23) Role Destroy (0.000773) DELETE FROM roles WHERE "id" = 23 RoleAssignment Load (0.000521) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000484) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000518) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001069) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000493) ROLLBACK SQL (0.000357) BEGIN User Load (0.000850) SELECT * FROM users WHERE (users."id" = 2) Store Load (0.000767) SELECT * FROM stores WHERE (stores."id" = 2) Firm Load (0.000637) SELECT * FROM firms WHERE (firms."id" = 3) User Load (0.000829) SELECT * FROM users WHERE (users."id" = 5) User Load (0.000627) SELECT * FROM users WHERE (users."id" = 6) SQL (0.003087) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Firm Load (0.001401) SELECT * FROM firms WHERE (firms."id" = 2) Role Load (0.001248) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 Permission Load (0.001655) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 6 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: create Role test role() Role Create (0.001108) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:14.995076', 2, E'test role', 5, '2008-03-03 21:20:14.995076') SQL (0.000455) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) Firm Load (0.000813) SELECT * FROM firms WHERE (firms."id" = 2) SQL (0.001788) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(24) SQL (0.002026) select 'x' from roles where id = 24 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.000853) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:15.018352', 24, 5, NULL, '2008-03-03 21:20:15.018352', NULL) SQL (0.000410) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000660) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001056) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001047) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: place Order X() === permission check: edit Role test role(24) SQL (0.002122) select 'x' from roles where id = 24 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001067) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Order', 'f', 'f', '2008-03-03 21:20:15.037854', NULL, NULL, 24, NULL, 'f', NULL, '2008-03-03 21:20:15.037854', E'place', 2) SQL (0.000436) SELECT currval('permissions_id_seq') Permission Load (0.001247) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: place Order X() Order Create (0.001159) INSERT INTO orders ("shipped", "updated_at", "notes", "owner_firm_id", "paid", "owner_id", "shipping_address", "store_id", "payment_authenticator", "created_at") VALUES('f', '2008-03-03 21:20:15.045975', NULL, 3, 'f', 2, NULL, 2, NULL, '2008-03-03 21:20:15.028727') SQL (0.000469) SELECT currval('orders_id_seq') === permission check: destroy Role test role(24) Role Destroy (0.000964) DELETE FROM roles WHERE "id" = 24 RoleAssignment Load (0.000647) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000586) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000591) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.002800) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000741) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Role Load (0.001135) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 === permission check: create Role test role() Role Create (0.001068) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:15.073384', 2, E'test role', 5, '2008-03-03 21:20:15.073384') SQL (0.000406) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) SQL (0.001886) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(25) SQL (0.002308) select 'x' from roles where id = 25 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.002062) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:15.093502', 25, 5, NULL, '2008-03-03 21:20:15.093502', NULL) SQL (0.000930) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000754) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001099) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000919) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: place Order X(4) === permission check: edit Role test role(25) SQL (0.002108) select 'x' from roles where id = 25 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001195) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Order', 'f', 'f', '2008-03-03 21:20:15.115073', NULL, NULL, 25, NULL, 'f', NULL, '2008-03-03 21:20:15.115073', E'place', 2) SQL (0.000492) SELECT currval('permissions_id_seq') Permission Load (0.001342) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: place Order X(4) === permission check: place Order X(4) === permission check: destroy Role test role(25) Role Destroy (0.000977) DELETE FROM roles WHERE "id" = 25 RoleAssignment Load (0.000591) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000540) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000630) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001043) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000552) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Role Load (0.000898) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 === permission check: create Role test role() Role Create (0.001351) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:15.140211', 2, E'test role', 5, '2008-03-03 21:20:15.140211') SQL (0.000459) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) SQL (0.002028) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(26) SQL (0.001933) select 'x' from roles where id = 26 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.000911) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:15.160847', 26, 5, NULL, '2008-03-03 21:20:15.160847', NULL) SQL (0.000400) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000711) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001076) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000884) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: edit Order X(4) === permission check: edit Role test role(26) SQL (0.002194) select 'x' from roles where id = 26 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001091) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Order', 'f', 'f', '2008-03-03 21:20:15.181003', NULL, NULL, 26, NULL, 'f', NULL, '2008-03-03 21:20:15.181003', E'edit', 2) SQL (0.000451) SELECT currval('permissions_id_seq') Permission Load (0.002368) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: edit Order X(4) === permission check: edit Order X(4) === permission check: edit Order X(4) === permission check: edit Order X(4) === permission check: destroy Role test role(26) Role Destroy (0.000964) DELETE FROM roles WHERE "id" = 26 RoleAssignment Load (0.000547) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000483) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000548) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001572) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) Order Update (0.001321) UPDATE orders SET "created_at" = '2008-03-03 21:20:15.028727', "owner_firm_id" = 3, "payment_authenticator" = E'0123456789', "owner_id" = 2, "store_id" = 2, "shipping_address" = E'3 cherry tree lane, nowhere, CA, 00000', "notes" = NULL, "paid" = 't', "updated_at" = '2008-03-03 21:20:15.217031', "shipped" = 'f' WHERE "id" = 4 === FAILED permission check: forbidden_operation Order X(4) SQL (0.000500) ROLLBACK SQL (0.000312) BEGIN User Load (0.000861) SELECT * FROM users WHERE (users."id" = 3) Firm Load (0.000893) SELECT * FROM firms WHERE (firms."id" = 3) Role Load (0.000883) SELECT * FROM roles WHERE (roles."id" = 3) SQL (0.000454) ROLLBACK SQL (0.000296) BEGIN Firm Load (0.000890) SELECT * FROM firms WHERE (firms."id" = 1) User Load (0.001160) SELECT * FROM users WHERE (users."id" = 4) User Load (0.001159) SELECT * FROM users WHERE (users."id" = 5) User Load (0.001442) SELECT * FROM users WHERE (users."id" = 6) SQL (0.001375) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Firm Load (0.000655) SELECT * FROM firms WHERE (firms."id" = 2) Role Load (0.001133) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 Permission Load (0.001633) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 6 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: create Role test role() Role Create (0.001047) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:15.274680', 2, E'test role', 5, '2008-03-03 21:20:15.274680') SQL (0.000401) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) Firm Load (0.000814) SELECT * FROM firms WHERE (firms."id" = 2) SQL (0.001868) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(27) SQL (0.002022) select 'x' from roles where id = 27 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.002136) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:15.297535', 27, 5, NULL, '2008-03-03 21:20:15.297535', NULL) SQL (0.000922) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000795) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001245) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001224) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: create Product twinkie() === permission check: edit Role test role(27) SQL (0.002153) select 'x' from roles where id = 27 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.002240) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Product', 'f', 'f', '2008-03-03 21:20:15.322745', NULL, NULL, 27, NULL, 'f', NULL, '2008-03-03 21:20:15.322745', E'create', NULL) SQL (0.000922) SELECT currval('permissions_id_seq') Permission Load (0.002973) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: create Product twinkie() PK and serial sequence (0.006005) SELECT attr.attname, seq.relname FROM pg_class seq, pg_attribute attr, pg_depend dep, pg_namespace name, pg_constraint cons WHERE seq.oid = dep.objid AND seq.relkind = 'S' AND attr.attrelid = dep.refobjid AND attr.attnum = dep.refobjsubid AND attr.attrelid = cons.conrelid AND attr.attnum = cons.conkey[1] AND cons.contype = 'p' AND dep.refobjid = 'products'::regclass Product Create (0.029160) INSERT INTO products ("image_url", "name", "price", "owner_firm_id", "description", "owner_id") VALUES(NULL, E'twinkie', 0.8, 1, E'A tasty pastry, guaranteed to survive refrigeration, mold, rot, and the fall of civilization', 4) SQL (0.000503) SELECT currval('products_id_seq') === permission check: destroy Role test role(27) Role Destroy (0.001027) DELETE FROM roles WHERE "id" = 27 RoleAssignment Load (0.000598) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000571) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000742) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.000768) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000658) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Role Load (0.001138) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 === permission check: create Role test role() Role Create (0.000991) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:15.391508', 2, E'test role', 5, '2008-03-03 21:20:15.391508') SQL (0.000431) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) SQL (0.002468) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(28) SQL (0.001899) select 'x' from roles where id = 28 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.000909) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:15.409290', 28, 5, NULL, '2008-03-03 21:20:15.409290', NULL) SQL (0.000432) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000662) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001066) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000909) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: update Product twinkie(4) === permission check: edit Role test role(28) SQL (0.002186) select 'x' from roles where id = 28 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.000992) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Product', 'f', 'f', '2008-03-03 21:20:15.428049', NULL, NULL, 28, NULL, 'f', NULL, '2008-03-03 21:20:15.428049', E'update', NULL) SQL (0.000480) SELECT currval('permissions_id_seq') Permission Load (0.001326) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: update Product twinkie(4) Product Update (0.001797) UPDATE products SET "owner_firm_id" = 1, "owner_id" = 4, "name" = E'twinkie', "image_url" = NULL, "description" = E'A tasty pastry, guaranteed to survive refrigeration, mold, rot, and the fall of civilization', "price" = 0.8 WHERE "id" = 4 === permission check: destroy Role test role(28) Role Destroy (0.000971) DELETE FROM roles WHERE "id" = 28 RoleAssignment Load (0.000566) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000530) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000529) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001032) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000532) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Role Load (0.000888) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 === permission check: create Role test role() Role Create (0.001052) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:15.455002', 2, E'test role', 5, '2008-03-03 21:20:15.455002') SQL (0.000466) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) SQL (0.002046) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(29) SQL (0.002036) select 'x' from roles where id = 29 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.000797) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:15.472967', 29, 5, NULL, '2008-03-03 21:20:15.472967', NULL) SQL (0.000426) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000642) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001090) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000936) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: destroy Product twinkie(4) === permission check: edit Role test role(29) SQL (0.003242) select 'x' from roles where id = 29 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001416) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Product', 'f', 'f', '2008-03-03 21:20:15.494479', NULL, NULL, 29, NULL, 'f', NULL, '2008-03-03 21:20:15.494479', E'destroy', NULL) SQL (0.000472) SELECT currval('permissions_id_seq') Permission Load (0.001493) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: destroy Product twinkie(4) Product Destroy (0.001158) DELETE FROM products WHERE "id" = 4 === permission check: destroy Role test role(29) Role Destroy (0.001020) DELETE FROM roles WHERE "id" = 29 RoleAssignment Load (0.000601) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000539) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000603) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001189) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000505) ROLLBACK SQL (0.000371) BEGIN Role Load (0.000753) SELECT * FROM roles WHERE (roles."id" = 2) Firm Load (0.000634) SELECT * FROM firms WHERE (firms."id" = 3) SQL (0.000344) ROLLBACK SQL (0.000295) BEGIN Firm Load (0.000707) SELECT * FROM firms WHERE (firms."id" = 4) Role Load (0.000635) SELECT * FROM roles WHERE (roles.name IS NULL AND roles.owner_firm_id IS NULL) LIMIT 1 Role Load (0.000708) SELECT * FROM roles WHERE (roles.name IS NULL AND roles.owner_firm_id = 4) LIMIT 1 User Load (0.000757) SELECT * FROM users WHERE (users."id" = 2) Role Load (0.000633) SELECT * FROM roles WHERE (roles.name IS NULL AND roles.owner_firm_id = 4) LIMIT 1 Role Load (0.000612) SELECT * FROM roles WHERE (roles.name IS NULL AND roles.owner_firm_id = 4) LIMIT 1 Role Load (0.001780) SELECT * FROM roles WHERE (roles.name = E'' AND roles.owner_firm_id = 4) LIMIT 1 Role Load (0.001069) SELECT * FROM roles WHERE (roles.name = E'x' AND roles.owner_firm_id = 4) LIMIT 1 Role Load (0.000994) SELECT * FROM roles WHERE (roles.name = E'ab' AND roles.owner_firm_id = 4) LIMIT 1 Role Load (0.001147) SELECT * FROM roles WHERE (roles.name = E'admin' AND roles.owner_firm_id = 4) LIMIT 1 Role Load (0.001067) SELECT * FROM roles WHERE (roles.name = E'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' AND roles.owner_firm_id = 4) LIMIT 1 Role Load (0.000971) SELECT * FROM roles WHERE (roles.name = E'twiddler' AND roles.owner_firm_id = 4) LIMIT 1 Role Load (0.000880) SELECT * FROM roles WHERE (roles.name = E'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' AND roles.owner_firm_id = 4) LIMIT 1 Role Load (0.000867) SELECT * FROM roles WHERE (roles.name = E'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' AND roles.owner_firm_id = 4) LIMIT 1 User Load (0.000703) SELECT * FROM users WHERE (users."id" = 5) User Load (0.000634) SELECT * FROM users WHERE (users."id" = 6) SQL (0.000592) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Firm Load (0.000753) SELECT * FROM firms WHERE (firms."id" = 2) Role Load (0.001051) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 Permission Load (0.001588) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 6 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: create Role test role() Role Create (0.001118) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:15.567609', 2, E'test role', 5, '2008-03-03 21:20:15.567609') SQL (0.000425) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) Firm Load (0.000830) SELECT * FROM firms WHERE (firms."id" = 2) SQL (0.001964) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(30) SQL (0.002173) select 'x' from roles where id = 30 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.000929) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:15.591207', 30, 5, NULL, '2008-03-03 21:20:15.591207', NULL) SQL (0.000406) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000753) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001085) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001439) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) Role Load (0.000873) SELECT * FROM roles WHERE (roles.name = E'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' AND roles.owner_firm_id = 4) LIMIT 1 === FAILED permission check: create Role xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx() === permission check: edit Role test role(30) SQL (0.001993) select 'x' from roles where id = 30 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.002597) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Role', 'f', 'f', '2008-03-03 21:20:15.614720', NULL, NULL, 30, 4, 'f', NULL, '2008-03-03 21:20:15.614720', E'create', NULL) SQL (0.001192) SELECT currval('permissions_id_seq') Permission Load (0.002941) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) Role Load (0.001177) SELECT * FROM roles WHERE (roles.name = E'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' AND roles.owner_firm_id = 4) LIMIT 1 === permission check: create Role xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx() Role Create (0.001150) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', '2008-03-03 21:20:15.633873', 4, E'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 2, '2008-03-03 21:20:15.605199') SQL (0.000421) SELECT currval('roles_id_seq') === permission check: destroy Role test role(30) Role Destroy (0.001018) DELETE FROM roles WHERE "id" = 30 RoleAssignment Load (0.000570) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000573) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000575) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001051) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000434) ROLLBACK SQL (0.000299) BEGIN User Load (0.000706) SELECT * FROM users WHERE (users."id" = 3) Firm Load (0.000706) SELECT * FROM firms WHERE (firms."id" = 3) User Load (0.000898) SELECT * FROM users WHERE (users."id" = 5) User Load (0.000796) SELECT * FROM users WHERE (users."id" = 6) SQL (0.000613) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Firm Load (0.000611) SELECT * FROM firms WHERE (firms."id" = 2) Role Load (0.001083) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 Permission Load (0.004574) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 6 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: create Role test role() Role Create (0.001002) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:15.670633', 2, E'test role', 5, '2008-03-03 21:20:15.670633') SQL (0.000393) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) Firm Load (0.001718) SELECT * FROM firms WHERE (firms."id" = 2) SQL (0.001893) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(32) SQL (0.002138) select 'x' from roles where id = 32 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.001003) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:15.698284', 32, 5, NULL, '2008-03-03 21:20:15.698284', NULL) SQL (0.000418) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000695) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001233) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001105) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: create Store lucy's candies() === permission check: edit Role test role(32) SQL (0.002139) select 'x' from roles where id = 32 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001387) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Store', 'f', 'f', '2008-03-03 21:20:15.718097', NULL, NULL, 32, NULL, 'f', NULL, '2008-03-03 21:20:15.718097', E'create', NULL) SQL (0.000652) SELECT currval('permissions_id_seq') Permission Load (0.002081) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: create Store lucy's candies() PK and serial sequence (0.005889) SELECT attr.attname, seq.relname FROM pg_class seq, pg_attribute attr, pg_depend dep, pg_namespace name, pg_constraint cons WHERE seq.oid = dep.objid AND seq.relkind = 'S' AND attr.attrelid = dep.refobjid AND attr.attnum = dep.refobjsubid AND attr.attrelid = cons.conrelid AND attr.attnum = cons.conkey[1] AND cons.contype = 'p' AND dep.refobjid = 'stores'::regclass Store Create (0.001079) INSERT INTO stores ("name", "owner_firm_id", "description", "owner_id") VALUES(E'lucy''s candies', 3, E'products from the candy factory in the modern times ep', 3) SQL (0.000444) SELECT currval('stores_id_seq') === permission check: destroy Role test role(32) Role Destroy (0.001424) DELETE FROM roles WHERE "id" = 32 RoleAssignment Load (0.030912) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.003081) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000823) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001080) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001383) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Role Load (0.001124) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 === permission check: create Role test role() Role Create (0.001100) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:15.917528', 2, E'test role', 5, '2008-03-03 21:20:15.917528') SQL (0.000459) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) SQL (0.001904) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(33) SQL (0.002071) select 'x' from roles where id = 33 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.001019) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:15.935806', 33, 5, NULL, '2008-03-03 21:20:15.935806', NULL) SQL (0.000410) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000669) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001175) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001071) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: update Store lucy's candies(3) === permission check: edit Role test role(33) SQL (0.002299) select 'x' from roles where id = 33 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001456) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Store', 'f', 'f', '2008-03-03 21:20:15.959014', NULL, NULL, 33, NULL, 'f', NULL, '2008-03-03 21:20:15.959014', E'update', NULL) SQL (0.000475) SELECT currval('permissions_id_seq') Permission Load (0.001445) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: update Store lucy's candies(3) Store Update (0.001536) UPDATE stores SET "owner_firm_id" = 3, "owner_id" = 3, "name" = E'lucy''s candies', "description" = E'products from the candy factory in the modern times ep' WHERE "id" = 3 === permission check: destroy Role test role(33) Role Destroy (0.000771) DELETE FROM roles WHERE "id" = 33 RoleAssignment Load (0.000533) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000487) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000802) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001207) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001419) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Role Load (0.001037) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 === permission check: create Role test role() Role Create (0.001021) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:15.991703', 2, E'test role', 5, '2008-03-03 21:20:15.991703') SQL (0.000414) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) SQL (0.001960) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(34) SQL (0.002058) select 'x' from roles where id = 34 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.001024) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:16.010771', 34, 5, NULL, '2008-03-03 21:20:16.010771', NULL) SQL (0.000488) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000767) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.002030) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001183) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: destroy Store lucy's candies(3) === permission check: edit Role test role(34) SQL (0.002731) select 'x' from roles where id = 34 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.002254) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Store', 'f', 'f', '2008-03-03 21:20:16.034353', NULL, NULL, 34, NULL, 'f', NULL, '2008-03-03 21:20:16.034353', E'destroy', NULL) SQL (0.000430) SELECT currval('permissions_id_seq') Permission Load (0.001443) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: destroy Store lucy's candies(3) Store Destroy (0.001817) DELETE FROM stores WHERE "id" = 3 === permission check: destroy Role test role(34) Role Destroy (0.000850) DELETE FROM roles WHERE "id" = 34 RoleAssignment Load (0.000538) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000498) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000526) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001123) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000543) ROLLBACK SQL (0.000364) BEGIN User Load (0.001053) SELECT * FROM users WHERE (users."id" = 1) User Load (0.000769) SELECT * FROM users WHERE (users."id" = 2) SQL (0.000357) ROLLBACK SQL (0.000685) BEGIN User Load (0.001208) SELECT * FROM users WHERE (users."id" = 2) User Load (0.000836) SELECT * FROM users WHERE (users."id" = 5) User Load (0.000823) SELECT * FROM users WHERE (users."id" = 6) SQL (0.000659) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Firm Load (0.000830) SELECT * FROM firms WHERE (firms."id" = 2) Role Load (0.001227) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 Permission Load (0.001661) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 6 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: create Role test role() Role Create (0.002456) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:16.083389', 2, E'test role', 5, '2008-03-03 21:20:16.083389') SQL (0.001001) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) Firm Load (0.000904) SELECT * FROM firms WHERE (firms."id" = 2) SQL (0.001866) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(35) SQL (0.001886) select 'x' from roles where id = 35 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.000868) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:16.117200', 35, 5, NULL, '2008-03-03 21:20:16.117200', NULL) SQL (0.000435) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000804) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001270) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001019) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: set_password User ethel(2) === permission check: edit Role test role(35) SQL (0.002128) select 'x' from roles where id = 35 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001282) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'User', 'f', 'f', '2008-03-03 21:20:16.135751', 2, E'ethel', 35, NULL, 'f', NULL, '2008-03-03 21:20:16.135751', E'set_password', NULL) SQL (0.000430) SELECT currval('permissions_id_seq') Permission Load (0.001457) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) Firm Load (0.001039) SELECT * FROM firms WHERE (firms."id" = 4) === permission check: set_password User ethel(2) === permission check: destroy Role test role(35) Role Destroy (0.000895) DELETE FROM roles WHERE "id" = 35 RoleAssignment Load (0.000601) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000549) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000553) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001049) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) User Load (0.002747) SELECT * FROM users WHERE (users.name = E'ethel' AND users.owner_firm_id = 4 AND users.id <> 2) LIMIT 1 SQL (0.000743) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Role Load (0.001276) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 === permission check: create Role test role() Role Create (0.000972) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:16.184305', 2, E'test role', 5, '2008-03-03 21:20:16.184305') SQL (0.000417) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) SQL (0.002114) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(36) SQL (0.002191) select 'x' from roles where id = 36 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.000991) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:16.203165', 36, 5, NULL, '2008-03-03 21:20:16.203165', NULL) SQL (0.000438) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000719) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001158) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: edit Role test role(36) SQL (0.004610) select 'x' from roles where id = 36 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.002403) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Firm', 'f', 'f', '2008-03-03 21:20:16.227741', NULL, NULL, 36, NULL, 'f', NULL, '2008-03-03 21:20:16.227741', E'update', NULL) SQL (0.000734) SELECT currval('permissions_id_seq') Permission Load (0.001573) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) Firm Load (0.001000) SELECT * FROM firms WHERE (firms.name = E'Mertz' AND firms.id <> 4) LIMIT 1 Firm Load (0.000863) SELECT * FROM firms WHERE (firms.full_name = E'Bank of Mertz' AND firms.id <> 4) LIMIT 1 === permission check: update Firm Mertz(4) Firm Update (0.001185) UPDATE firms SET "created_at" = '2006-10-31 00:00:00.000000', "max_bad_logins" = 3, "bad_login_dead_minutes" = 5, "search_name" = E'mertz', "name" = E'Mertz', "password_lifetime_days" = NULL, "full_name" = E'Bank of Mertz', "updated_at" = '2008-03-03 21:20:16.244351' WHERE "id" = 4 === permission check: destroy Role test role(36) Role Destroy (0.000820) DELETE FROM roles WHERE "id" = 36 RoleAssignment Load (0.000534) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000495) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000521) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001048) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) User Load (0.001114) SELECT * FROM users WHERE (users.name = E'ethel' AND users.owner_firm_id = 4 AND users.id <> 2) LIMIT 1 User Update (0.001471) UPDATE users SET "no_login_until" = NULL, "created_at" = '2006-10-31 00:00:00.000000', "bad_logins_since_lockout" = 1, "search_name" = E'ethel', "owner_firm_id" = 4, "password_expires_at" = NULL, "bad_login_attempts" = 1, "name" = E'ethel', "password_hash" = E'51351cf17c5d21386260719cffb47d35b64156deba40148c9c112c5f5a8e9e28', "locked_out" = NULL, "last_login_at" = NULL, "full_name" = E'Ethel Mertz', "updated_at" = '2008-03-03 21:20:16.260385', "password_salt" = E'b4DsVKjH 0' WHERE "id" = 2 User Load (0.001197) SELECT * FROM users WHERE (users.name = E'ethel' AND users.owner_firm_id = 4 AND users.id <> 2) LIMIT 1 User Update (0.001629) UPDATE users SET "no_login_until" = NULL, "created_at" = '2006-10-31 00:00:00.000000', "bad_logins_since_lockout" = 2, "search_name" = E'ethel', "owner_firm_id" = 4, "password_expires_at" = NULL, "bad_login_attempts" = 2, "name" = E'ethel', "password_hash" = E'51351cf17c5d21386260719cffb47d35b64156deba40148c9c112c5f5a8e9e28', "locked_out" = NULL, "last_login_at" = NULL, "full_name" = E'Ethel Mertz', "updated_at" = '2008-03-03 21:20:16.268374', "password_salt" = E'b4DsVKjH 0' WHERE "id" = 2 User Load (0.002170) SELECT * FROM users WHERE (users.name = E'ethel' AND users.owner_firm_id = 4 AND users.id <> 2) LIMIT 1 User Update (0.001374) UPDATE users SET "no_login_until" = '2008-03-03 21:25:16.273328', "created_at" = '2006-10-31 00:00:00.000000', "bad_logins_since_lockout" = NULL, "search_name" = E'ethel', "owner_firm_id" = 4, "password_expires_at" = NULL, "bad_login_attempts" = 3, "name" = E'ethel', "password_hash" = E'51351cf17c5d21386260719cffb47d35b64156deba40148c9c112c5f5a8e9e28', "locked_out" = NULL, "last_login_at" = NULL, "full_name" = E'Ethel Mertz', "updated_at" = '2008-03-03 21:20:16.277388', "password_salt" = E'b4DsVKjH 0' WHERE "id" = 2 User Load (0.001105) SELECT * FROM users WHERE (users.name = E'ethel' AND users.owner_firm_id = 4 AND users.id <> 2) LIMIT 1 User Update (0.003028) UPDATE users SET "no_login_until" = '2008-03-03 21:20:13.282262', "created_at" = '2006-10-31 00:00:00.000000', "bad_logins_since_lockout" = 1, "search_name" = E'ethel', "owner_firm_id" = 4, "password_expires_at" = NULL, "bad_login_attempts" = 4, "name" = E'ethel', "password_hash" = E'51351cf17c5d21386260719cffb47d35b64156deba40148c9c112c5f5a8e9e28', "locked_out" = NULL, "last_login_at" = NULL, "full_name" = E'Ethel Mertz', "updated_at" = '2008-03-03 21:20:16.285641', "password_salt" = E'b4DsVKjH 0' WHERE "id" = 2 User Load (0.001865) SELECT * FROM users WHERE (users.name = E'ethel' AND users.owner_firm_id = 4 AND users.id <> 2) LIMIT 1 User Update (0.001417) UPDATE users SET "no_login_until" = NULL, "created_at" = '2006-10-31 00:00:00.000000', "bad_logins_since_lockout" = NULL, "search_name" = E'ethel', "owner_firm_id" = 4, "password_expires_at" = NULL, "bad_login_attempts" = NULL, "name" = E'ethel', "password_hash" = E'51351cf17c5d21386260719cffb47d35b64156deba40148c9c112c5f5a8e9e28', "locked_out" = NULL, "last_login_at" = '2008-03-03 21:20:16.295457', "full_name" = E'Ethel Mertz', "updated_at" = '2008-03-03 21:20:16.300580', "password_salt" = E'b4DsVKjH 0' WHERE "id" = 2 SQL (0.000514) ROLLBACK SQL (0.000296) BEGIN User Load (0.000804) SELECT * FROM users WHERE (users."id" = 2) User Load (0.000675) SELECT * FROM users WHERE (users."id" = 5) User Load (0.000668) SELECT * FROM users WHERE (users."id" = 6) SQL (0.000621) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Firm Load (0.000694) SELECT * FROM firms WHERE (firms."id" = 2) Role Load (0.001086) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 Permission Load (0.001998) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 6 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: create Role test role() Role Create (0.002269) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:16.318624', 2, E'test role', 5, '2008-03-03 21:20:16.318624') SQL (0.000842) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) Firm Load (0.000901) SELECT * FROM firms WHERE (firms."id" = 2) SQL (0.001923) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(37) SQL (0.005111) select 'x' from roles where id = 37 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.002311) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:16.352376', 37, 5, NULL, '2008-03-03 21:20:16.352376', NULL) SQL (0.001103) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.001690) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001171) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001069) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: set_password User ethel(2) === permission check: edit Role test role(37) SQL (0.002147) select 'x' from roles where id = 37 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.000989) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'User', 'f', 'f', '2008-03-03 21:20:16.377789', 2, E'ethel', 37, NULL, 'f', NULL, '2008-03-03 21:20:16.377789', E'set_password', NULL) SQL (0.000460) SELECT currval('permissions_id_seq') Permission Load (0.001994) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) Firm Load (0.001393) SELECT * FROM firms WHERE (firms."id" = 4) === permission check: set_password User ethel(2) === permission check: destroy Role test role(37) Role Destroy (0.002319) DELETE FROM roles WHERE "id" = 37 RoleAssignment Load (0.001513) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.001343) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000696) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001120) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) User Load (0.001076) SELECT * FROM users WHERE (users.name = E'ethel' AND users.owner_firm_id = 4 AND users.id <> 2) LIMIT 1 User Load (0.000898) SELECT * FROM users WHERE (users.name = E'ethel' AND users.owner_firm_id = 4 AND users.id <> 2) LIMIT 1 User Update (0.001147) UPDATE users SET "no_login_until" = NULL, "created_at" = '2006-10-31 00:00:00.000000', "bad_logins_since_lockout" = NULL, "search_name" = E'ethel', "owner_firm_id" = 4, "password_expires_at" = NULL, "bad_login_attempts" = NULL, "name" = E'ethel', "password_hash" = E'32d39d7d38c3945b8ce2f774879b99e3824ffdfba64bcdf49617feb24030b50b', "locked_out" = NULL, "last_login_at" = NULL, "full_name" = E'Ethel Mertz', "updated_at" = '2008-03-03 21:20:16.427561', "password_salt" = E'35JoaAQ4 0' WHERE "id" = 2 User Load (0.000954) SELECT * FROM users WHERE (users."id" = 2) SQL (0.000745) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Role Load (0.000930) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 === permission check: create Role test role() Role Create (0.002246) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:16.439482', 2, E'test role', 5, '2008-03-03 21:20:16.439482') SQL (0.000951) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) SQL (0.002198) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(38) SQL (0.002274) select 'x' from roles where id = 38 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.001061) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:16.465594', 38, 5, NULL, '2008-03-03 21:20:16.465594', NULL) SQL (0.000425) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000730) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001369) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001011) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: set_password User ethel(2) === permission check: edit Role test role(38) SQL (0.005112) select 'x' from roles where id = 38 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001009) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'User', 'f', 'f', '2008-03-03 21:20:16.491407', 2, E'ethel', 38, NULL, 'f', NULL, '2008-03-03 21:20:16.491407', E'set_password', NULL) SQL (0.000444) SELECT currval('permissions_id_seq') Permission Load (0.001320) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) Firm Load (0.001836) SELECT * FROM firms WHERE (firms."id" = 4) === permission check: set_password User ethel(2) === permission check: destroy Role test role(38) Role Destroy (0.000901) DELETE FROM roles WHERE "id" = 38 RoleAssignment Load (0.000529) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000476) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000581) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001104) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) User Load (0.001179) SELECT * FROM users WHERE (users.name = E'ethel' AND users.owner_firm_id = 4 AND users.id <> 2) LIMIT 1 SQL (0.000495) ROLLBACK SQL (0.000324) BEGIN User Load (0.000977) SELECT * FROM users WHERE (users."id" = 4) Permission Load (0.002670) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 4 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: set_password User ricky(4) === permission check: set_password User ricky(4) === permission check: set_password User ricky(4) === permission check: set_password User ricky(4) === permission check: set_password User ricky(4) Firm Load (0.001769) SELECT * FROM firms WHERE (firms."id" = 3) === permission check: set_password User ricky(4) User Load (0.001135) SELECT * FROM users WHERE (users.name = E'ricky' AND users.owner_firm_id = 3 AND users.id <> 4) LIMIT 1 User Load (0.002274) SELECT * FROM users WHERE (users.name = E'ricky' AND users.owner_firm_id = 3 AND users.id <> 4) LIMIT 1 User Load (0.000904) SELECT * FROM users WHERE (users.name = E'ricky' AND users.owner_firm_id = 3 AND users.id <> 4) LIMIT 1 User Load (0.001053) SELECT * FROM users WHERE (users.name = E'ricky' AND users.owner_firm_id = 3 AND users.id <> 4) LIMIT 1 User Update (0.001420) UPDATE users SET "no_login_until" = NULL, "created_at" = '2006-10-31 00:00:00.000000', "bad_logins_since_lockout" = NULL, "search_name" = E'ricky', "owner_firm_id" = 3, "password_expires_at" = NULL, "bad_login_attempts" = NULL, "name" = E'ricky', "password_hash" = E'6b069ab61affa95c601f4e7b93fa78ff0a88e304408884b459cd335d347f0e4a', "locked_out" = NULL, "last_login_at" = NULL, "full_name" = E'Ricky Ricardo', "updated_at" = '2008-03-03 21:20:16.583207', "password_salt" = E'MZunf8Mu 0' WHERE "id" = 4 User Load (0.000938) SELECT * FROM users WHERE (users."id" = 4) SQL (0.000453) ROLLBACK SQL (0.000358) BEGIN User Load (0.000841) SELECT * FROM users WHERE (users."id" = 2) User Load (0.001935) SELECT * FROM users WHERE (users."id" = 5) User Load (0.001700) SELECT * FROM users WHERE (users."id" = 6) SQL (0.002061) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Firm Load (0.001024) SELECT * FROM firms WHERE (firms."id" = 2) Role Load (0.001051) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 Permission Load (0.001441) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 6 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: create Role test role() Role Create (0.000922) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:16.615240', 2, E'test role', 5, '2008-03-03 21:20:16.615240') SQL (0.000413) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) Firm Load (0.000891) SELECT * FROM firms WHERE (firms."id" = 2) SQL (0.001913) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(39) SQL (0.002049) select 'x' from roles where id = 39 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.000948) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:16.637909', 39, 5, NULL, '2008-03-03 21:20:16.637909', NULL) SQL (0.000397) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000693) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001072) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000934) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: set_password User ethel(2) === permission check: edit Role test role(39) SQL (0.002793) select 'x' from roles where id = 39 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.002438) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'User', 'f', 'f', '2008-03-03 21:20:16.656249', 2, E'ethel', 39, NULL, 'f', NULL, '2008-03-03 21:20:16.656249', E'set_password', NULL) SQL (0.000754) SELECT currval('permissions_id_seq') Permission Load (0.002316) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) Firm Load (0.000896) SELECT * FROM firms WHERE (firms."id" = 4) === permission check: set_password User ethel(2) === permission check: destroy Role test role(39) Role Destroy (0.000972) DELETE FROM roles WHERE "id" = 39 RoleAssignment Load (0.000541) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000478) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000548) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001121) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) User Load (0.001051) SELECT * FROM users WHERE (users.name = E'ethel' AND users.owner_firm_id = 4 AND users.id <> 2) LIMIT 1 User Load (0.000898) SELECT * FROM users WHERE (users.name = E'ethel' AND users.owner_firm_id = 4 AND users.id <> 2) LIMIT 1 User Update (0.001772) UPDATE users SET "no_login_until" = NULL, "created_at" = '2006-10-31 00:00:00.000000', "bad_logins_since_lockout" = NULL, "search_name" = E'ethel', "owner_firm_id" = 4, "password_expires_at" = NULL, "bad_login_attempts" = NULL, "name" = E'ethel', "password_hash" = E'60946bec865067febbb7a93812907d0eac7fa6b40285d3475eea385247dcc0e1', "locked_out" = NULL, "last_login_at" = '2008-03-03 21:20:16.705192', "full_name" = E'Ethel Mertz', "updated_at" = '2008-03-03 21:20:16.707821', "password_salt" = E'ANUO4AsZ 0' WHERE "id" = 2 SQL (0.000778) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Role Load (0.001078) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 === permission check: create Role test role() Role Create (0.001153) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:16.720196', 2, E'test role', 5, '2008-03-03 21:20:16.720196') SQL (0.000431) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) SQL (0.003505) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(40) SQL (0.004864) select 'x' from roles where id = 40 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.001064) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:16.748873', 40, 5, NULL, '2008-03-03 21:20:16.748873', NULL) SQL (0.000470) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000778) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001167) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001040) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: pw_administer User ethel(2) === permission check: edit Role test role(40) SQL (0.001969) select 'x' from roles where id = 40 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.000998) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'User', 'f', 'f', '2008-03-03 21:20:16.767030', 2, E'ethel', 40, NULL, 'f', NULL, '2008-03-03 21:20:16.767030', E'pw_administer', NULL) SQL (0.000544) SELECT currval('permissions_id_seq') Permission Load (0.002879) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: pw_administer User ethel(2) === permission check: pw_administer User ethel(2) === permission check: destroy Role test role(40) Role Destroy (0.001004) DELETE FROM roles WHERE "id" = 40 RoleAssignment Load (0.000695) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000522) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000597) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001200) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000724) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Role Load (0.001150) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 === permission check: create Role test role() Role Create (0.001022) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:16.801064', 2, E'test role', 5, '2008-03-03 21:20:16.801064') SQL (0.000398) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) SQL (0.001901) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(41) SQL (0.001972) select 'x' from roles where id = 41 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.000820) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:16.818535', 41, 5, NULL, '2008-03-03 21:20:16.818535', NULL) SQL (0.000393) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000634) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001045) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001003) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: pw_administer User ethel(2) === permission check: edit Role test role(41) SQL (0.002074) select 'x' from roles where id = 41 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001048) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'User', 'f', 'f', '2008-03-03 21:20:16.836322', 2, E'ethel', 41, NULL, 'f', NULL, '2008-03-03 21:20:16.836322', E'pw_administer', NULL) SQL (0.000588) SELECT currval('permissions_id_seq') Permission Load (0.001479) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: pw_administer User ethel(2) === permission check: pw_administer User ethel(2) === permission check: destroy Role test role(41) Role Destroy (0.000990) DELETE FROM roles WHERE "id" = 41 RoleAssignment Load (0.000601) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000530) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000625) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001115) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) User Load (0.001064) SELECT * FROM users WHERE (users.name = E'ethel' AND users.owner_firm_id = 4 AND users.id <> 2) LIMIT 1 User Update (0.001179) UPDATE users SET "no_login_until" = NULL, "created_at" = '2006-10-31 00:00:00.000000', "bad_logins_since_lockout" = NULL, "search_name" = E'ethel', "owner_firm_id" = 4, "password_expires_at" = NULL, "bad_login_attempts" = NULL, "name" = E'ethel', "password_hash" = E'60946bec865067febbb7a93812907d0eac7fa6b40285d3475eea385247dcc0e1', "locked_out" = 'f', "last_login_at" = '2008-03-03 21:20:16.856230', "full_name" = E'Ethel Mertz', "updated_at" = '2008-03-03 21:20:16.859155', "password_salt" = E'ANUO4AsZ 0' WHERE "id" = 2 SQL (0.000658) ROLLBACK SQL (0.000717) BEGIN User Load (0.001836) SELECT * FROM users WHERE (users."id" = 2) User Load (0.001777) SELECT * FROM users WHERE (users."id" = 5) User Load (0.001494) SELECT * FROM users WHERE (users."id" = 6) SQL (0.001376) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Firm Load (0.000740) SELECT * FROM firms WHERE (firms."id" = 2) Role Load (0.001678) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 Permission Load (0.001794) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 6 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: create Role test role() Role Create (0.001013) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:16.887423', 2, E'test role', 5, '2008-03-03 21:20:16.887423') SQL (0.000598) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) Firm Load (0.000804) SELECT * FROM firms WHERE (firms."id" = 2) SQL (0.002046) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(42) SQL (0.004952) select 'x' from roles where id = 42 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.002270) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:16.916499', 42, 5, NULL, '2008-03-03 21:20:16.916499', NULL) SQL (0.000984) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000707) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001248) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001162) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: set_password User ethel(2) === permission check: edit Role test role(42) SQL (0.002077) select 'x' from roles where id = 42 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.002080) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'User', 'f', 'f', '2008-03-03 21:20:16.939228', 2, E'ethel', 42, NULL, 'f', NULL, '2008-03-03 21:20:16.939228', E'set_password', NULL) SQL (0.000963) SELECT currval('permissions_id_seq') Permission Load (0.001567) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) Firm Load (0.000886) SELECT * FROM firms WHERE (firms."id" = 4) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: destroy Role test role(42) Role Destroy (0.001147) DELETE FROM roles WHERE "id" = 42 RoleAssignment Load (0.000652) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000529) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000580) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001155) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) User Load (0.001068) SELECT * FROM users WHERE (users.name = E'ethel' AND users.owner_firm_id = 4 AND users.id <> 2) LIMIT 1 User Load (0.001071) SELECT * FROM users WHERE (users.name = E'ethel' AND users.owner_firm_id = 4 AND users.id <> 2) LIMIT 1 User Update (0.002870) UPDATE users SET "no_login_until" = NULL, "created_at" = '2006-10-31 00:00:00.000000', "bad_logins_since_lockout" = 1, "search_name" = E'ethel', "owner_firm_id" = 4, "password_expires_at" = '2008-03-06 21:20:16.963015', "bad_login_attempts" = 1, "name" = E'ethel', "password_hash" = E'024e1c6818b7bba5ff638fe7ca1170fd2919384821a18c428e1ef08b9ccbfdbe', "locked_out" = NULL, "last_login_at" = NULL, "full_name" = E'Ethel Mertz', "updated_at" = '2008-03-03 21:20:16.982465', "password_salt" = E'OFkGLYfr 0' WHERE "id" = 2 User Load (0.001995) SELECT * FROM users WHERE (users.name = E'ethel' AND users.owner_firm_id = 4 AND users.id <> 2) LIMIT 1 User Update (0.001406) UPDATE users SET "no_login_until" = NULL, "created_at" = '2006-10-31 00:00:00.000000', "bad_logins_since_lockout" = NULL, "search_name" = E'ethel', "owner_firm_id" = 4, "password_expires_at" = '2008-03-06 21:20:16.963015', "bad_login_attempts" = NULL, "name" = E'ethel', "password_hash" = E'024e1c6818b7bba5ff638fe7ca1170fd2919384821a18c428e1ef08b9ccbfdbe', "locked_out" = NULL, "last_login_at" = '2008-03-03 21:20:16.995348', "full_name" = E'Ethel Mertz', "updated_at" = '2008-03-03 21:20:17.000695', "password_salt" = E'OFkGLYfr 0' WHERE "id" = 2 SQL (0.000532) ROLLBACK SQL (0.000334) BEGIN User Load (0.000875) SELECT * FROM users WHERE (users."id" = 2) Firm Load (0.000745) SELECT * FROM firms WHERE (firms."id" = 4) User Load (0.001008) SELECT * FROM users WHERE (users.name = E'ethel' AND users.owner_firm_id = 4 AND users.id <> 2) LIMIT 1 User Load (0.000702) SELECT * FROM users WHERE (users."id" = 5) User Load (0.000624) SELECT * FROM users WHERE (users."id" = 6) SQL (0.000554) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Firm Load (0.000709) SELECT * FROM firms WHERE (firms."id" = 2) Role Load (0.001110) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 Permission Load (0.001917) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 6 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: create Role test role() Role Create (0.001087) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:17.022892', 2, E'test role', 5, '2008-03-03 21:20:17.022892') SQL (0.000454) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) Firm Load (0.000935) SELECT * FROM firms WHERE (firms."id" = 2) SQL (0.002021) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(43) SQL (0.002094) select 'x' from roles where id = 43 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.000836) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:17.046833', 43, 5, NULL, '2008-03-03 21:20:17.046833', NULL) SQL (0.000401) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000628) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001230) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001001) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: set_password User ethel(2) === permission check: edit Role test role(43) SQL (0.001951) select 'x' from roles where id = 43 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001008) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'User', 'f', 'f', '2008-03-03 21:20:17.063756', 2, E'ethel', 43, NULL, 'f', NULL, '2008-03-03 21:20:17.063756', E'set_password', NULL) SQL (0.000413) SELECT currval('permissions_id_seq') Permission Load (0.001232) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: set_password User ethel(2) === permission check: destroy Role test role(43) Role Destroy (0.001593) DELETE FROM roles WHERE "id" = 43 RoleAssignment Load (0.001459) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000601) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000659) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001212) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) User Load (0.001279) SELECT * FROM users WHERE (users.name = E'ethel' AND users.owner_firm_id = 4 AND users.id <> 2) LIMIT 1 SQL (0.000721) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Role Load (0.001103) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 === permission check: create Role test role() Role Create (0.001143) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:17.093412', 2, E'test role', 5, '2008-03-03 21:20:17.093412') SQL (0.000412) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) SQL (0.004713) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(44) SQL (0.002134) select 'x' from roles where id = 44 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.000886) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:17.120660', 44, 5, NULL, '2008-03-03 21:20:17.120660', NULL) SQL (0.000401) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000783) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001061) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000957) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: set_password User ethel(2) === permission check: edit Role test role(44) SQL (0.002041) select 'x' from roles where id = 44 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001088) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'User', 'f', 'f', '2008-03-03 21:20:17.137875', 2, E'ethel', 44, NULL, 'f', NULL, '2008-03-03 21:20:17.137875', E'set_password', NULL) SQL (0.000462) SELECT currval('permissions_id_seq') Permission Load (0.001331) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: destroy Role test role(44) Role Destroy (0.001070) DELETE FROM roles WHERE "id" = 44 RoleAssignment Load (0.000687) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000555) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000579) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001149) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) User Load (0.001068) SELECT * FROM users WHERE (users.name = E'ethel' AND users.owner_firm_id = 4 AND users.id <> 2) LIMIT 1 SQL (0.000659) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Role Load (0.000890) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 === permission check: create Role test role() Role Create (0.001799) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:17.177401', 2, E'test role', 5, '2008-03-03 21:20:17.177401') SQL (0.000944) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) SQL (0.002616) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(45) SQL (0.002189) select 'x' from roles where id = 45 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.001068) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:17.200100', 45, 5, NULL, '2008-03-03 21:20:17.200100', NULL) SQL (0.000456) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000725) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001574) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001455) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: set_password User ethel(2) === permission check: edit Role test role(45) SQL (0.002038) select 'x' from roles where id = 45 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.000941) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'User', 'f', 'f', '2008-03-03 21:20:17.219004', 2, E'ethel', 45, NULL, 'f', NULL, '2008-03-03 21:20:17.219004', E'set_password', NULL) SQL (0.000393) SELECT currval('permissions_id_seq') Permission Load (0.001204) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: set_password User ethel(2) === permission check: destroy Role test role(45) Role Destroy (0.000957) DELETE FROM roles WHERE "id" = 45 RoleAssignment Load (0.000664) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000595) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000650) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.002698) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) User Load (0.002502) SELECT * FROM users WHERE (users.name = E'ethel' AND users.owner_firm_id = 4 AND users.id <> 2) LIMIT 1 User Load (0.002458) SELECT * FROM users WHERE (users.name = E'ethel' AND users.owner_firm_id = 4 AND users.id <> 2) LIMIT 1 User Update (0.001287) UPDATE users SET "no_login_until" = NULL, "created_at" = '2006-10-31 00:00:00.000000', "bad_logins_since_lockout" = NULL, "search_name" = E'ethel', "owner_firm_id" = 4, "password_expires_at" = NULL, "bad_login_attempts" = NULL, "name" = E'ethel', "password_hash" = E'879a46953769136495f8d07f53c448f74985ddf96914aab429a3582d81eae20f', "locked_out" = NULL, "last_login_at" = NULL, "full_name" = E'Ethel Mertz', "updated_at" = '2008-03-03 21:20:17.252373', "password_salt" = E'DWOeB5VO 0' WHERE "id" = 2 User Load (0.001020) SELECT * FROM users WHERE (users."id" = 2) SQL (0.000476) ROLLBACK SQL (0.000321) BEGIN User Load (0.000843) SELECT * FROM users WHERE (users."id" = 2) User Load (0.000704) SELECT * FROM users WHERE (users."id" = 5) User Load (0.000613) SELECT * FROM users WHERE (users."id" = 6) SQL (0.000658) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Firm Load (0.000683) SELECT * FROM firms WHERE (firms."id" = 2) Role Load (0.001171) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 Permission Load (0.004750) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 6 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: create Role test role() Role Create (0.001100) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:17.273363', 2, E'test role', 5, '2008-03-03 21:20:17.273363') SQL (0.000405) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) Firm Load (0.000800) SELECT * FROM firms WHERE (firms."id" = 2) SQL (0.001745) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(46) SQL (0.002000) select 'x' from roles where id = 46 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.000927) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:17.301959', 46, 5, NULL, '2008-03-03 21:20:17.301959', NULL) SQL (0.000441) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000667) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001077) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001821) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: set_password User ethel(2) === permission check: edit Role test role(46) SQL (0.002852) select 'x' from roles where id = 46 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001052) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'User', 'f', 'f', '2008-03-03 21:20:17.326964', 2, E'ethel', 46, NULL, 'f', NULL, '2008-03-03 21:20:17.326964', E'set_password', NULL) SQL (0.000448) SELECT currval('permissions_id_seq') Permission Load (0.001315) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) Firm Load (0.000880) SELECT * FROM firms WHERE (firms."id" = 4) === permission check: set_password User ethel(2) === permission check: destroy Role test role(46) Role Destroy (0.000902) DELETE FROM roles WHERE "id" = 46 RoleAssignment Load (0.000649) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000609) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000652) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001246) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) User Load (0.001672) SELECT * FROM users WHERE (users.name = E'ethel' AND users.owner_firm_id = 4 AND users.id <> 2) LIMIT 1 User Load (0.001107) SELECT * FROM users WHERE (users.name = E'ethel' AND users.owner_firm_id = 4 AND users.id <> 2) LIMIT 1 User Update (0.001437) UPDATE users SET "no_login_until" = NULL, "created_at" = '2006-10-31 00:00:00.000000', "bad_logins_since_lockout" = NULL, "search_name" = E'ethel', "owner_firm_id" = 4, "password_expires_at" = NULL, "bad_login_attempts" = NULL, "name" = E'ethel', "password_hash" = E'f4d972db443409ac24e4cda9e7a3146a1e26702176902e915ec97e1e28ea282f', "locked_out" = NULL, "last_login_at" = '2008-03-03 21:20:17.366739', "full_name" = E'Ethel Mertz', "updated_at" = '2008-03-03 21:20:17.369755', "password_salt" = E'wd8f/4TF 0' WHERE "id" = 2 SQL (0.000688) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Role Load (0.000960) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 === permission check: create Role test role() Role Create (0.002213) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:17.380133', 2, E'test role', 5, '2008-03-03 21:20:17.380133') SQL (0.000415) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) SQL (0.002081) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(47) SQL (0.004825) select 'x' from roles where id = 47 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.000982) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:17.407907', 47, 5, NULL, '2008-03-03 21:20:17.407907', NULL) SQL (0.000435) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000647) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001082) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000912) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: set_password User ethel(2) === permission check: edit Role test role(47) SQL (0.002146) select 'x' from roles where id = 47 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001100) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'User', 'f', 'f', '2008-03-03 21:20:17.428895', 2, E'ethel', 47, NULL, 'f', NULL, '2008-03-03 21:20:17.428895', E'set_password', NULL) SQL (0.000468) SELECT currval('permissions_id_seq') Permission Load (0.003216) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: destroy Role test role(47) Role Destroy (0.000940) DELETE FROM roles WHERE "id" = 47 RoleAssignment Load (0.000547) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000501) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000644) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001125) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) User Load (0.001062) SELECT * FROM users WHERE (users.name = E'ethel' AND users.owner_firm_id = 4 AND users.id <> 2) LIMIT 1 User Load (0.001079) SELECT * FROM users WHERE (users.name = E'ethel' AND users.owner_firm_id = 4 AND users.id <> 2) LIMIT 1 User Update (0.001384) UPDATE users SET "no_login_until" = NULL, "created_at" = '2006-10-31 00:00:00.000000', "bad_logins_since_lockout" = NULL, "search_name" = E'ethel', "owner_firm_id" = 4, "password_expires_at" = '2008-03-06 21:20:17.439227', "bad_login_attempts" = NULL, "name" = E'ethel', "password_hash" = E'f4d972db443409ac24e4cda9e7a3146a1e26702176902e915ec97e1e28ea282f', "locked_out" = NULL, "last_login_at" = '2008-03-03 21:20:17.456066', "full_name" = E'Ethel Mertz', "updated_at" = '2008-03-03 21:20:17.459161', "password_salt" = E'wd8f/4TF 0' WHERE "id" = 2 SQL (0.000744) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Role Load (0.001132) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 === permission check: create Role test role() Role Create (0.002442) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:17.472590', 2, E'test role', 5, '2008-03-03 21:20:17.472590') SQL (0.001021) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) SQL (0.004660) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(48) SQL (0.002045) select 'x' from roles where id = 48 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.001095) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:17.505790', 48, 5, NULL, '2008-03-03 21:20:17.505790', NULL) SQL (0.000473) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000811) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001301) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001196) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: set_password User ethel(2) === permission check: edit Role test role(48) SQL (0.002191) select 'x' from roles where id = 48 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001064) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'User', 'f', 'f', '2008-03-03 21:20:17.528995', 2, E'ethel', 48, NULL, 'f', NULL, '2008-03-03 21:20:17.528995', E'set_password', NULL) SQL (0.000463) SELECT currval('permissions_id_seq') Permission Load (0.003446) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: destroy Role test role(48) Role Destroy (0.001041) DELETE FROM roles WHERE "id" = 48 RoleAssignment Load (0.000657) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000581) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000566) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001135) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000466) ROLLBACK SQL (0.000691) BEGIN User Load (0.002013) SELECT * FROM users WHERE (users."id" = 1) SQL (0.000770) ROLLBACK SQL (0.000692) BEGIN User Load (0.000741) SELECT * FROM users WHERE (users."id" = 2) User Load (0.000836) SELECT * FROM users WHERE (users."id" = 5) User Load (0.000695) SELECT * FROM users WHERE (users."id" = 6) SQL (0.000601) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Firm Load (0.000683) SELECT * FROM firms WHERE (firms."id" = 2) Role Load (0.000990) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 Permission Load (0.002386) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 6 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: create Role test role() Role Create (0.001133) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:17.581535', 2, E'test role', 5, '2008-03-03 21:20:17.581535') SQL (0.000457) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) Firm Load (0.000940) SELECT * FROM firms WHERE (firms."id" = 2) SQL (0.001843) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(49) SQL (0.002022) select 'x' from roles where id = 49 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.000811) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:17.611475', 49, 5, NULL, '2008-03-03 21:20:17.611475', NULL) SQL (0.000394) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000704) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001215) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.002499) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: set_password User ethel(2) === permission check: edit Role test role(49) SQL (0.002056) select 'x' from roles where id = 49 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001055) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'User', 'f', 'f', '2008-03-03 21:20:17.632614', 2, E'ethel', 49, NULL, 'f', NULL, '2008-03-03 21:20:17.632614', E'set_password', NULL) SQL (0.000422) SELECT currval('permissions_id_seq') Permission Load (0.001350) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) Firm Load (0.000953) SELECT * FROM firms WHERE (firms."id" = 4) === permission check: set_password User ethel(2) === permission check: destroy Role test role(49) Role Destroy (0.000971) DELETE FROM roles WHERE "id" = 49 RoleAssignment Load (0.000667) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000595) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000654) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001182) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) User Load (0.001064) SELECT * FROM users WHERE (users.name = E'ethel' AND users.owner_firm_id = 4 AND users.id <> 2) LIMIT 1 User Update (0.001224) UPDATE users SET "no_login_until" = NULL, "created_at" = '2006-10-31 00:00:00.000000', "bad_logins_since_lockout" = NULL, "search_name" = E'ethel', "owner_firm_id" = 4, "password_expires_at" = NULL, "bad_login_attempts" = NULL, "name" = E'ethel', "password_hash" = E'725b3eea606c5d63f1ad2d6fb08760daf2f045b646e2ce8bdce76b5a58e56cd2', "locked_out" = NULL, "last_login_at" = NULL, "full_name" = E'Ethel Mertz', "updated_at" = '2008-03-03 21:20:17.673587', "password_salt" = E'YoTDKwId 0' WHERE "id" = 2 User Load (0.002072) SELECT * FROM users WHERE (users."id" = 2) SQL (0.001404) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Role Load (0.002751) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 === permission check: create Role test role() Role Create (0.001066) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:17.695696', 2, E'test role', 5, '2008-03-03 21:20:17.695696') SQL (0.000419) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) SQL (0.002537) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(50) SQL (0.005003) select 'x' from roles where id = 50 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.000966) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:17.723276', 50, 5, NULL, '2008-03-03 21:20:17.723276', NULL) SQL (0.000409) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000758) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001074) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000924) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: set_password User ethel(2) === permission check: edit Role test role(50) SQL (0.001946) select 'x' from roles where id = 50 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001587) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'User', 'f', 'f', '2008-03-03 21:20:17.742225', 2, E'ethel', 50, NULL, 'f', NULL, '2008-03-03 21:20:17.742225', E'set_password', NULL) SQL (0.000467) SELECT currval('permissions_id_seq') Permission Load (0.001440) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) Firm Load (0.000869) SELECT * FROM firms WHERE (firms."id" = 4) === permission check: set_password User ethel(2) === permission check: destroy Role test role(50) Role Destroy (0.002003) DELETE FROM roles WHERE "id" = 50 RoleAssignment Load (0.000844) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000558) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000523) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001040) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000426) ROLLBACK SQL (0.000292) BEGIN User Load (0.000703) SELECT * FROM users WHERE (users."id" = 2) User Load (0.000662) SELECT * FROM users WHERE (users."id" = 5) User Load (0.001502) SELECT * FROM users WHERE (users."id" = 6) SQL (0.001552) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Firm Load (0.033987) SELECT * FROM firms WHERE (firms."id" = 2) Role Load (0.003400) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 Permission Load (0.001688) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 6 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: create Role test role() Role Create (0.001081) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:17.974523', 2, E'test role', 5, '2008-03-03 21:20:17.974523') SQL (0.000443) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) Firm Load (0.002011) SELECT * FROM firms WHERE (firms."id" = 2) SQL (0.001939) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(51) SQL (0.001992) select 'x' from roles where id = 51 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.001243) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:17.999849', 51, 5, NULL, '2008-03-03 21:20:17.999849', NULL) SQL (0.000428) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000784) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001308) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001159) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: set_password User ethel(2) === permission check: edit Role test role(51) SQL (0.002187) select 'x' from roles where id = 51 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001039) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'User', 'f', 'f', '2008-03-03 21:20:18.021828', 2, E'ethel', 51, NULL, 'f', NULL, '2008-03-03 21:20:18.021828', E'set_password', NULL) SQL (0.000409) SELECT currval('permissions_id_seq') Permission Load (0.001231) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) Firm Load (0.002041) SELECT * FROM firms WHERE (firms."id" = 4) === permission check: set_password User ethel(2) === permission check: destroy Role test role(51) Role Destroy (0.001035) DELETE FROM roles WHERE "id" = 51 RoleAssignment Load (0.000594) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000594) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000618) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001095) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) User Load (0.000940) SELECT * FROM users WHERE (users.name = E'ethel' AND users.owner_firm_id = 4 AND users.id <> 2) LIMIT 1 SQL (0.000770) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Role Load (0.001096) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 === permission check: create Role test role() Role Create (0.001115) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:18.072001', 2, E'test role', 5, '2008-03-03 21:20:18.072001') SQL (0.000447) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) SQL (0.003040) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(52) SQL (0.002473) select 'x' from roles where id = 52 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.001001) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:18.097408', 52, 5, NULL, '2008-03-03 21:20:18.097408', NULL) SQL (0.000452) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000734) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001219) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.002231) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: set_password User ethel(2) === permission check: edit Role test role(52) SQL (0.002095) select 'x' from roles where id = 52 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.000961) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'User', 'f', 'f', '2008-03-03 21:20:18.123596', 2, E'ethel', 52, NULL, 'f', NULL, '2008-03-03 21:20:18.123596', E'set_password', NULL) SQL (0.000402) SELECT currval('permissions_id_seq') Permission Load (0.001276) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: destroy Role test role(52) Role Destroy (0.001006) DELETE FROM roles WHERE "id" = 52 RoleAssignment Load (0.000635) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.001113) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000627) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001282) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) User Load (0.000977) SELECT * FROM users WHERE (users.name = E'ethel' AND users.owner_firm_id = 4 AND users.id <> 2) LIMIT 1 SQL (0.000592) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Role Load (0.001011) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 === permission check: create Role test role() Role Create (0.001103) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:18.170710', 2, E'test role', 5, '2008-03-03 21:20:18.170710') SQL (0.000475) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) SQL (0.002179) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(53) SQL (0.001975) select 'x' from roles where id = 53 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.000855) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:18.189395', 53, 5, NULL, '2008-03-03 21:20:18.189395', NULL) SQL (0.000401) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000741) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001185) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000960) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: set_password User ethel(2) === permission check: edit Role test role(53) SQL (0.001966) select 'x' from roles where id = 53 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001043) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'User', 'f', 'f', '2008-03-03 21:20:18.206696', 2, E'ethel', 53, NULL, 'f', NULL, '2008-03-03 21:20:18.206696', E'set_password', NULL) SQL (0.000470) SELECT currval('permissions_id_seq') Permission Load (0.001514) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: destroy Role test role(53) Role Destroy (0.002204) DELETE FROM roles WHERE "id" = 53 RoleAssignment Load (0.001381) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000987) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000658) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001088) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) User Load (0.000967) SELECT * FROM users WHERE (users.name = E'ethel' AND users.owner_firm_id = 4 AND users.id <> 2) LIMIT 1 SQL (0.000594) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Role Load (0.001083) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 === permission check: create Role test role() Role Create (0.001060) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:18.249502', 2, E'test role', 5, '2008-03-03 21:20:18.249502') SQL (0.000418) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) SQL (0.001975) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(54) SQL (0.002346) select 'x' from roles where id = 54 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.002140) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:18.269586', 54, 5, NULL, '2008-03-03 21:20:18.269586', NULL) SQL (0.001057) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.001725) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.003313) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.002112) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: set_password User ethel(2) === permission check: edit Role test role(54) SQL (0.002210) select 'x' from roles where id = 54 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001035) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'User', 'f', 'f', '2008-03-03 21:20:18.302048', 2, E'ethel', 54, NULL, 'f', NULL, '2008-03-03 21:20:18.302048', E'set_password', NULL) SQL (0.000426) SELECT currval('permissions_id_seq') Permission Load (0.001244) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: destroy Role test role(54) Role Destroy (0.000911) DELETE FROM roles WHERE "id" = 54 RoleAssignment Load (0.000561) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000485) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000557) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001094) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) User Load (0.001060) SELECT * FROM users WHERE (users.name = E'ethel' AND users.owner_firm_id = 4 AND users.id <> 2) LIMIT 1 SQL (0.000796) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Role Load (0.001173) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 === permission check: create Role test role() Role Create (0.002032) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:18.344987', 2, E'test role', 5, '2008-03-03 21:20:18.344987') SQL (0.001065) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) SQL (0.002038) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(55) SQL (0.001968) select 'x' from roles where id = 55 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.000897) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:18.364990', 55, 5, NULL, '2008-03-03 21:20:18.364990', NULL) SQL (0.000417) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000683) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001059) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001105) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: set_password User ethel(2) === permission check: edit Role test role(55) SQL (0.005414) select 'x' from roles where id = 55 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001045) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'User', 'f', 'f', '2008-03-03 21:20:18.394553', 2, E'ethel', 55, NULL, 'f', NULL, '2008-03-03 21:20:18.394553', E'set_password', NULL) SQL (0.000419) SELECT currval('permissions_id_seq') Permission Load (0.001232) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: destroy Role test role(55) Role Destroy (0.000989) DELETE FROM roles WHERE "id" = 55 RoleAssignment Load (0.000628) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000555) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000571) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001211) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) User Load (0.002641) SELECT * FROM users WHERE (users.name = E'ethel' AND users.owner_firm_id = 4 AND users.id <> 2) LIMIT 1 SQL (0.001228) ROLLBACK SQL (0.000605) BEGIN User Load (0.000965) SELECT * FROM users WHERE (users."id" = 1) User Load (0.000796) SELECT * FROM users WHERE (users."id" = 5) User Load (0.000748) SELECT * FROM users WHERE (users."id" = 6) SQL (0.000633) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Firm Load (0.000631) SELECT * FROM firms WHERE (firms."id" = 2) Role Load (0.004120) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 Permission Load (0.003723) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 6 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: create Role test role() Role Create (0.001132) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:18.450923', 2, E'test role', 5, '2008-03-03 21:20:18.450923') SQL (0.000480) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) Firm Load (0.000884) SELECT * FROM firms WHERE (firms."id" = 2) SQL (0.002094) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(56) SQL (0.002130) select 'x' from roles where id = 56 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.000902) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:18.478855', 56, 5, NULL, '2008-03-03 21:20:18.478855', NULL) SQL (0.000408) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000709) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001063) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.002303) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: rename User fred(1) === permission check: edit Role test role(56) SQL (0.001996) select 'x' from roles where id = 56 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001124) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'User', 'f', 'f', '2008-03-03 21:20:18.498606', 1, E'fred', 56, NULL, 'f', NULL, '2008-03-03 21:20:18.498606', E'rename', NULL) SQL (0.000468) SELECT currval('permissions_id_seq') Permission Load (0.002084) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: rename User fred(1) === permission check: rename User frederick(1) === permission check: destroy Role test role(56) Role Destroy (0.000955) DELETE FROM roles WHERE "id" = 56 RoleAssignment Load (0.001226) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000502) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000527) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001029) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000609) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Role Load (0.001080) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 === permission check: create Role test role() Role Create (0.001044) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:18.526549', 2, E'test role', 5, '2008-03-03 21:20:18.526549') SQL (0.000432) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) SQL (0.002097) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(57) SQL (0.004967) select 'x' from roles where id = 57 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.000927) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:18.556217', 57, 5, NULL, '2008-03-03 21:20:18.556217', NULL) SQL (0.000430) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000691) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001066) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000897) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: rename User frederick(1) === permission check: edit Role test role(57) SQL (0.002074) select 'x' from roles where id = 57 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001040) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'User', 'f', 'f', '2008-03-03 21:20:18.575106', 1, E'frederick', 57, NULL, 'f', NULL, '2008-03-03 21:20:18.575106', E'rename', NULL) SQL (0.000417) SELECT currval('permissions_id_seq') Permission Load (0.001244) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: rename User frederick(1) === permission check: rename User frederick(1) === permission check: destroy Role test role(57) Role Destroy (0.001109) DELETE FROM roles WHERE "id" = 57 RoleAssignment Load (0.000615) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000651) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000583) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001117) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000461) ROLLBACK SQL (0.000333) BEGIN User Load (0.000853) SELECT * FROM users WHERE (users."id" = 2) User Load (0.001972) SELECT * FROM users WHERE (users."id" = 5) User Load (0.001454) SELECT * FROM users WHERE (users."id" = 6) SQL (0.001356) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Firm Load (0.001452) SELECT * FROM firms WHERE (firms."id" = 2) Role Load (0.001156) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 Permission Load (0.001568) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 6 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: create Role test role() Role Create (0.000949) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:18.618708', 2, E'test role', 5, '2008-03-03 21:20:18.618708') SQL (0.000766) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) Firm Load (0.000881) SELECT * FROM firms WHERE (firms."id" = 2) SQL (0.001878) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(58) SQL (0.001955) select 'x' from roles where id = 58 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.001002) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:18.645095', 58, 5, NULL, '2008-03-03 21:20:18.645095', NULL) SQL (0.000463) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000797) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001191) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001218) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: set_password User ethel(2) === permission check: edit Role test role(58) SQL (0.002154) select 'x' from roles where id = 58 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.000998) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'User', 'f', 'f', '2008-03-03 21:20:18.663538', 2, E'ethel', 58, NULL, 'f', NULL, '2008-03-03 21:20:18.663538', E'set_password', NULL) SQL (0.000400) SELECT currval('permissions_id_seq') Permission Load (0.001205) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) Firm Load (0.002184) SELECT * FROM firms WHERE (firms."id" = 4) === permission check: set_password User ethel(2) === permission check: destroy Role test role(58) Role Destroy (0.001047) DELETE FROM roles WHERE "id" = 58 RoleAssignment Load (0.000662) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000514) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000654) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001219) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) User Load (0.001068) SELECT * FROM users WHERE (users.name = E'ethel' AND users.owner_firm_id = 4 AND users.id <> 2) LIMIT 1 SQL (0.001739) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Role Load (0.002489) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 === permission check: create Role test role() Role Create (0.001069) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:18.728179', 2, E'test role', 5, '2008-03-03 21:20:18.728179') SQL (0.000467) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) SQL (0.001970) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(59) SQL (0.002077) select 'x' from roles where id = 59 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.000847) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:18.748248', 59, 5, NULL, '2008-03-03 21:20:18.748248', NULL) SQL (0.000407) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000670) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001585) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: edit Role test role(59) SQL (0.002018) select 'x' from roles where id = 59 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.000903) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'Firm', 'f', 'f', '2008-03-03 21:20:18.762498', NULL, NULL, 59, NULL, 'f', NULL, '2008-03-03 21:20:18.762498', E'update', NULL) SQL (0.000394) SELECT currval('permissions_id_seq') Permission Load (0.001289) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) Firm Load (0.001164) SELECT * FROM firms WHERE (firms.name = E'Mertz' AND firms.id <> 4) LIMIT 1 Firm Load (0.001091) SELECT * FROM firms WHERE (firms.full_name = E'Bank of Mertz' AND firms.id <> 4) LIMIT 1 === permission check: update Firm Mertz(4) Firm Update (0.001342) UPDATE firms SET "created_at" = '2006-10-31 00:00:00.000000', "max_bad_logins" = 1, "bad_login_dead_minutes" = 5, "search_name" = E'mertz', "name" = E'Mertz', "password_lifetime_days" = NULL, "full_name" = E'Bank of Mertz', "updated_at" = '2008-03-03 21:20:18.773490' WHERE "id" = 4 === permission check: destroy Role test role(59) Role Destroy (0.002657) DELETE FROM roles WHERE "id" = 59 RoleAssignment Load (0.001769) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.001310) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.001383) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001126) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) User Load (0.001098) SELECT * FROM users WHERE (users.name = E'ethel' AND users.owner_firm_id = 4 AND users.id <> 2) LIMIT 1 User Update (0.001249) UPDATE users SET "no_login_until" = '2008-03-03 21:25:18.795372', "created_at" = '2006-10-31 00:00:00.000000', "bad_logins_since_lockout" = NULL, "search_name" = E'ethel', "owner_firm_id" = 4, "password_expires_at" = NULL, "bad_login_attempts" = 1, "name" = E'ethel', "password_hash" = E'2e5ccc95cec96be017cfe360f22bd05506056e7aa0631c5878099605fa2a2d10', "locked_out" = NULL, "last_login_at" = NULL, "full_name" = E'Ethel Mertz', "updated_at" = '2008-03-03 21:20:18.798463', "password_salt" = E'CCic+zlT 0' WHERE "id" = 2 SQL (0.000727) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Role Load (0.001094) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 === permission check: create Role test role() Role Create (0.001040) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:18.809477', 2, E'test role', 5, '2008-03-03 21:20:18.809477') SQL (0.000420) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) SQL (0.001910) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(60) SQL (0.004523) select 'x' from roles where id = 60 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.000950) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:18.832620', 60, 5, NULL, '2008-03-03 21:20:18.832620', NULL) SQL (0.000431) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000861) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001269) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001053) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: pw_administer User ethel() === permission check: edit Role test role(60) SQL (0.002237) select 'x' from roles where id = 60 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.002377) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'User', 'f', 'f', '2008-03-03 21:20:18.852579', NULL, NULL, 60, NULL, 'f', NULL, '2008-03-03 21:20:18.852579', E'pw_administer', NULL) SQL (0.001006) SELECT currval('permissions_id_seq') Permission Load (0.003052) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: pw_administer User ethel() === permission check: destroy Role test role(60) Role Destroy (0.000897) DELETE FROM roles WHERE "id" = 60 RoleAssignment Load (0.000546) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000502) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000525) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001019) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000672) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Role Load (0.001277) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 === permission check: create Role test role() Role Create (0.001105) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:18.888293', 2, E'test role', 5, '2008-03-03 21:20:18.888293') SQL (0.000426) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) SQL (0.002038) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(61) SQL (0.002219) select 'x' from roles where id = 61 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.000811) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:18.908524', 61, 5, NULL, '2008-03-03 21:20:18.908524', NULL) SQL (0.000413) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000631) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001044) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.002303) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: pw_administer User ethel() === permission check: edit Role test role(61) SQL (0.002199) select 'x' from roles where id = 61 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.000977) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'User', 'f', 'f', '2008-03-03 21:20:18.930227', NULL, NULL, 61, NULL, 'f', NULL, '2008-03-03 21:20:18.930227', E'pw_administer', NULL) SQL (0.000397) SELECT currval('permissions_id_seq') Permission Load (0.002117) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: pw_administer User ethel() === permission check: destroy Role test role(61) Role Destroy (0.000911) DELETE FROM roles WHERE "id" = 61 RoleAssignment Load (0.000560) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000484) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000515) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001049) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000575) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Role Load (0.002401) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 === permission check: create Role test role() Role Create (0.001102) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:18.959114', 2, E'test role', 5, '2008-03-03 21:20:18.959114') SQL (0.000473) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) SQL (0.002113) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(62) SQL (0.002054) select 'x' from roles where id = 62 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.000932) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:18.979866', 62, 5, NULL, '2008-03-03 21:20:18.979866', NULL) SQL (0.000403) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.001550) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.002847) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.002669) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: pw_administer User ethel() === permission check: edit Role test role(62) SQL (0.002201) select 'x' from roles where id = 62 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.002290) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'User', 'f', 'f', '2008-03-03 21:20:19.007511', NULL, NULL, 62, NULL, 'f', NULL, '2008-03-03 21:20:19.007511', E'pw_administer', NULL) SQL (0.000925) SELECT currval('permissions_id_seq') Permission Load (0.002919) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: pw_administer User ethel() === permission check: pw_administer User ethel() === permission check: destroy Role test role(62) Role Destroy (0.000900) DELETE FROM roles WHERE "id" = 62 RoleAssignment Load (0.000603) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000529) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000594) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001844) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000525) ROLLBACK SQL (0.000461) BEGIN User Load (0.000914) SELECT * FROM users WHERE (users."id" = 2) User Load (0.000819) SELECT * FROM users WHERE (users."id" = 5) User Load (0.000854) SELECT * FROM users WHERE (users."id" = 6) SQL (0.000673) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Firm Load (0.000752) SELECT * FROM firms WHERE (firms."id" = 2) Role Load (0.002018) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 Permission Load (0.001606) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 6 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: create Role test role() Role Create (0.001271) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:19.050840', 2, E'test role', 5, '2008-03-03 21:20:19.050840') SQL (0.000440) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) Firm Load (0.000898) SELECT * FROM firms WHERE (firms."id" = 2) SQL (0.001980) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(63) SQL (0.001973) select 'x' from roles where id = 63 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.000870) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:19.082307', 63, 5, NULL, '2008-03-03 21:20:19.082307', NULL) SQL (0.000414) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000686) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001239) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.000929) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: set_password User ethel(2) === permission check: edit Role test role(63) SQL (0.002151) select 'x' from roles where id = 63 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001081) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'User', 'f', 'f', '2008-03-03 21:20:19.101732', 2, E'ethel', 63, NULL, 'f', NULL, '2008-03-03 21:20:19.101732', E'set_password', NULL) SQL (0.000430) SELECT currval('permissions_id_seq') Permission Load (0.002946) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) Firm Load (0.000913) SELECT * FROM firms WHERE (firms."id" = 4) === permission check: set_password User ethel(2) === permission check: destroy Role test role(63) Role Destroy (0.000840) DELETE FROM roles WHERE "id" = 63 RoleAssignment Load (0.000570) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000555) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000667) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001259) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) User Load (0.001123) SELECT * FROM users WHERE (users.name = E'ethel' AND users.owner_firm_id = 4 AND users.id <> 2) LIMIT 1 SQL (0.000614) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Role Load (0.001003) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 === permission check: create Role test role() Role Create (0.000991) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:19.147066', 2, E'test role', 5, '2008-03-03 21:20:19.147066') SQL (0.000428) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) SQL (0.001964) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(64) SQL (0.001916) select 'x' from roles where id = 64 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.001911) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:19.165034', 64, 5, NULL, '2008-03-03 21:20:19.165034', NULL) SQL (0.000934) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.001690) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.002862) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001131) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) === FAILED permission check: set_password User ethel(2) === permission check: edit Role test role(64) SQL (0.002290) select 'x' from roles where id = 64 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.002357) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'User', 'f', 'f', '2008-03-03 21:20:19.191836', 2, E'ethel', 64, NULL, 'f', NULL, '2008-03-03 21:20:19.191836', E'set_password', NULL) SQL (0.000934) SELECT currval('permissions_id_seq') Permission Load (0.003225) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: set_password User ethel(2) === permission check: destroy Role test role(64) Role Destroy (0.001074) DELETE FROM roles WHERE "id" = 64 RoleAssignment Load (0.000549) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.000481) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.000529) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001893) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001102) ROLLBACK SQL (0.000745) BEGIN User Load (0.001627) SELECT * FROM users WHERE (users.name IS NULL AND users.owner_firm_id IS NULL) LIMIT 1 Firm Load (0.000811) SELECT * FROM firms WHERE (firms."id" = 4) User Load (0.000940) SELECT * FROM users WHERE (users.name IS NULL AND users.owner_firm_id IS NULL) LIMIT 1 User Load (0.001036) SELECT * FROM users WHERE (users.name IS NULL AND users.owner_firm_id = 4) LIMIT 1 User Load (0.001171) SELECT * FROM users WHERE (users.name = E'' AND users.owner_firm_id = 4) LIMIT 1 User Load (0.001083) SELECT * FROM users WHERE (users.name = E'a' AND users.owner_firm_id = 4) LIMIT 1 User Load (0.001046) SELECT * FROM users WHERE (users.name = E'ab' AND users.owner_firm_id = 4) LIMIT 1 User Load (0.001689) SELECT * FROM users WHERE (users.name = E'fred' AND users.owner_firm_id = 4) LIMIT 1 User Load (0.000964) SELECT * FROM users WHERE (users.name = E'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' AND users.owner_firm_id = 4) LIMIT 1 User Load (0.000847) SELECT * FROM users WHERE (users.name = E'ricky' AND users.owner_firm_id = 4) LIMIT 1 User Load (0.000913) SELECT * FROM users WHERE (users.name = E'rocky' AND users.owner_firm_id = 4) LIMIT 1 User Load (0.001083) SELECT * FROM users WHERE (users.name = E'bullwinkle' AND users.owner_firm_id = 4) LIMIT 1 User Load (0.000903) SELECT * FROM users WHERE (users.name = E'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' AND users.owner_firm_id = 4) LIMIT 1 User Load (0.000855) SELECT * FROM users WHERE (users.name = E'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' AND users.owner_firm_id = 4) LIMIT 1 User Load (0.000838) SELECT * FROM users WHERE (users.name = E'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' AND users.owner_firm_id = 4) LIMIT 1 User Load (0.000963) SELECT * FROM users WHERE (users.name = E'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' AND users.owner_firm_id = 4) LIMIT 1 User Load (0.001611) SELECT * FROM users WHERE (users.name = E'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' AND users.owner_firm_id = 4) LIMIT 1 User Load (0.000960) SELECT * FROM users WHERE (users.name = E'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' AND users.owner_firm_id = 4) LIMIT 1 User Load (0.000847) SELECT * FROM users WHERE (users.name = E'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' AND users.owner_firm_id = 4) LIMIT 1 User Load (0.000988) SELECT * FROM users WHERE (users.name = E'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' AND users.owner_firm_id = 4) LIMIT 1 User Load (0.000947) SELECT * FROM users WHERE (users.name = E'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' AND users.owner_firm_id = 4) LIMIT 1 User Load (0.000744) SELECT * FROM users WHERE (users."id" = 5) User Load (0.000621) SELECT * FROM users WHERE (users."id" = 6) SQL (0.000566) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Firm Load (0.001625) SELECT * FROM firms WHERE (firms."id" = 2) Role Load (0.002505) SELECT * FROM roles WHERE (roles.name = E'test role' AND roles.owner_firm_id = 2) LIMIT 1 Permission Load (0.003767) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 6 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: create Role test role() Role Create (0.001149) INSERT INTO roles ("name", "updated_at", "owner_firm_id", "search_name", "owner_id", "created_at") VALUES(E'test role', '2008-03-03 21:20:19.328171', 2, E'test role', 5, '2008-03-03 21:20:19.328171') SQL (0.000660) SELECT currval('roles_id_seq') === permission check: administer User unprivileged(5) Firm Load (0.000890) SELECT * FROM firms WHERE (firms."id" = 2) SQL (0.001913) select 'x' from users where id = 5 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'administer' or p.privilege = 'any') and (p.class_name = E'User') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or users.id = 6) and (p.target_id is null or users.id = p.target_id) and (p.target_owner_firm_id is null or users.owner_firm_id = p.target_owner_firm_id) ) === permission check: assign Role test role(65) SQL (0.001933) select 'x' from roles where id = 65 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'assign' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) RoleAssignment Create (0.002026) INSERT INTO role_assignments ("default_firm_id", "updated_at", "role_id", "user_id", "invalid_after", "created_at", "default_user_id") VALUES(NULL, '2008-03-03 21:20:19.354930', 65, 5, NULL, '2008-03-03 21:20:19.354930', NULL) SQL (0.001037) SELECT currval('role_assignments_id_seq') RoleAssignment Load (0.000823) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.001250) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001146) SELECT count(*) AS count_all FROM roles INNER JOIN role_assignments ON roles.id = role_assignments.role_id WHERE ((role_assignments.user_id = 5) AND (( (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ))) User Load (0.001224) SELECT * FROM users WHERE (users.name = E'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' AND users.owner_firm_id = 4) LIMIT 1 === FAILED permission check: create User xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx() === permission check: edit Role test role(65) SQL (0.002167) select 'x' from roles where id = 65 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 6 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Role') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or roles.owner_id = 6) and (p.target_owner_id is null or roles.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or roles.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or roles.id = p.target_id) ) Permission Create (0.001351) INSERT INTO permissions ("class_name", "is_grant", "target_owned_by_self", "updated_at", "target_id", "target_name", "role_id", "target_owner_firm_id", "has_grant_option", "target_paid", "created_at", "privilege", "target_owner_id") VALUES(E'User', 'f', 'f', '2008-03-03 21:20:19.385172', NULL, NULL, 65, 4, 'f', NULL, '2008-03-03 21:20:19.385172', E'create', NULL) SQL (0.001060) SELECT currval('permissions_id_seq') Permission Load (0.003112) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) User Load (0.001154) SELECT * FROM users WHERE (users.name = E'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' AND users.owner_firm_id = 4) LIMIT 1 === permission check: create User xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx() PK and serial sequence (0.006177) SELECT attr.attname, seq.relname FROM pg_class seq, pg_attribute attr, pg_depend dep, pg_namespace name, pg_constraint cons WHERE seq.oid = dep.objid AND seq.relkind = 'S' AND attr.attrelid = dep.refobjid AND attr.attnum = dep.refobjsubid AND attr.attrelid = cons.conrelid AND attr.attnum = cons.conkey[1] AND cons.contype = 'p' AND dep.refobjid = 'users'::regclass User Create (0.001281) INSERT INTO users ("last_login_at", "name", "updated_at", "password_expires_at", "bad_login_attempts", "password_salt", "owner_firm_id", "search_name", "bad_logins_since_lockout", "locked_out", "password_hash", "full_name", "created_at", "no_login_until") VALUES(NULL, E'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', '2008-03-03 21:20:19.400975', NULL, NULL, NULL, 4, E'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', NULL, NULL, NULL, E'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', '2008-03-03 21:20:19.373186', NULL) SQL (0.000461) SELECT currval('users_id_seq') === permission check: destroy Role test role(65) Role Destroy (0.002133) DELETE FROM roles WHERE "id" = 65 RoleAssignment Load (0.001430) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) RoleAssignment Load (0.001212) SELECT * FROM role_assignments WHERE (role_assignments.user_id = 5) SQL (0.001354) SELECT count(*) AS count_all FROM role_assignments WHERE (role_assignments.user_id = 5) Permission Load (0.002555) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 5 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) SQL (0.001110) ROLLBACK SQL (0.000805) SHOW client_min_messages SQL (0.000460) SET client_min_messages TO 'panic' SQL (0.000412) SHOW standard_conforming_strings SQL (0.000359) SET client_min_messages TO 'notice' SQL (0.000958) SELECT version() SQL (0.000305) BEGIN User Load (0.001125) SELECT * FROM users WHERE (users."id" = 6) Firm Load (0.002354) SELECT * FROM firms WHERE (firms."name" = E'simpson') LIMIT 1 Processing FirmController#index (for 0.0.0.0 at 2008-03-03 21:20:25) [POST] Session ID: Parameters: {"new_firm"=>{"name"=>"simpson", "full_name"=>"Bank of the Simpsons"}, "action"=>"index", "controller"=>"firm", "create"=>"1"} User Load (0.000971) SELECT * FROM users WHERE (users."id" = 6) CACHE (0.000000) SELECT * FROM users WHERE (users."id" = 6) SQL (0.002117) SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = 'request_log_entries'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum Firm Load (0.001098) SELECT * FROM firms WHERE (firms.name = E'simpson') LIMIT 1 Firm Load (0.000838) SELECT * FROM firms WHERE (firms.full_name = E'Bank of the Simpsons') LIMIT 1 Permission Load (0.005156) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 6 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: create Firm simpson() PK and serial sequence (0.005881) SELECT attr.attname, seq.relname FROM pg_class seq, pg_attribute attr, pg_depend dep, pg_namespace name, pg_constraint cons WHERE seq.oid = dep.objid AND seq.relkind = 'S' AND attr.attrelid = dep.refobjid AND attr.attnum = dep.refobjsubid AND attr.attrelid = cons.conrelid AND attr.attnum = cons.conkey[1] AND cons.contype = 'p' AND dep.refobjid = 'firms'::regclass Firm Create (0.001015) INSERT INTO firms ("name", "updated_at", "bad_login_dead_minutes", "search_name", "full_name", "max_bad_logins", "password_lifetime_days", "created_at") VALUES(E'simpson', '2008-03-03 21:20:25.077443', NULL, E'simpson', E'Bank of the Simpsons', NULL, NULL, '2008-03-03 21:20:25.077443') SQL (0.000665) SELECT currval('firms_id_seq') Redirected to http://test.host/firm PK and serial sequence (0.005750) SELECT attr.attname, seq.relname FROM pg_class seq, pg_attribute attr, pg_depend dep, pg_namespace name, pg_constraint cons WHERE seq.oid = dep.objid AND seq.relkind = 'S' AND attr.attrelid = dep.refobjid AND attr.attnum = dep.refobjsubid AND attr.attrelid = cons.conrelid AND attr.attnum = cons.conkey[1] AND cons.contype = 'p' AND dep.refobjid = 'request_log_entries'::regclass RequestLogEntry Create (0.001685) INSERT INTO request_log_entries ("remote_ip", "status", "updated_at", "http_method", "model_class", "acting_user_id", "action", "controller", "acting_user_name", "user_of_record_name", "created_at", "model_id", "user_of_record_id") VALUES(E'0.0.0.0', E'302 Found', '2008-03-03 21:20:25.114082', E'post', NULL, 6, E'index', E'FirmController', E'very_privileged', E'very_privileged', '2008-03-03 21:20:25.114082', NULL, 6) SQL (0.001073) SELECT currval('request_log_entries_id_seq') SQL (0.001979) SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = 'pcheck_log_entries'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum PK and serial sequence (0.007240) SELECT attr.attname, seq.relname FROM pg_class seq, pg_attribute attr, pg_depend dep, pg_namespace name, pg_constraint cons WHERE seq.oid = dep.objid AND seq.relkind = 'S' AND attr.attrelid = dep.refobjid AND attr.attnum = dep.refobjsubid AND attr.attrelid = cons.conrelid AND attr.attnum = cons.conkey[1] AND cons.contype = 'p' AND dep.refobjid = 'pcheck_log_entries'::regclass PcheckLogEntry Create (0.005064) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(1, '2008-03-03 21:20:25.144405', E'Firm', 't', 6, E'very_privileged', '2008-03-03 21:20:25.144405', NULL, E'create') SQL (0.001242) SELECT currval('pcheck_log_entries_id_seq') Completed in 0.10976 (9 reqs/sec) | DB: 0.04855 (44%) | 302 Found [http://test.host/firm?create=1&new_firm%5Bfull_name%5D=Bank+of+the+Simpsons&new_firm%5Bname%5D=simpson] Firm Load (0.002583) SELECT * FROM firms WHERE (firms."name" = E'simpson') LIMIT 1 SQL (0.002349) ROLLBACK SQL (0.000755) BEGIN User Load (0.001476) SELECT * FROM users WHERE (users."id" = 6) Processing FirmController#index (for 0.0.0.0 at 2008-03-03 21:20:25) [POST] Session ID: Parameters: {"new_firm"=>{"name"=>"simpson", "full_name"=>""}, "action"=>"index", "controller"=>"firm", "create"=>"1"} User Load (0.000955) SELECT * FROM users WHERE (users."id" = 6) CACHE (0.000000) SELECT * FROM users WHERE (users."id" = 6) Firm Load (0.001029) SELECT * FROM firms WHERE (firms.name = E'simpson') LIMIT 1 Firm Load (0.000853) SELECT * FROM firms WHERE (firms.full_name = E'') LIMIT 1 Rendering template within layouts/admin Rendering firm/index SQL (0.000647) SHOW max_identifier_length SQL (0.000750) SELECT count(*) AS count_all FROM firms Firm Load (0.000767) SELECT * FROM firms Permission Load (0.001492) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 6 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) CACHE (0.000000) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 6 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) RequestLogEntry Create (0.001108) INSERT INTO request_log_entries ("remote_ip", "status", "updated_at", "http_method", "model_class", "acting_user_id", "action", "controller", "acting_user_name", "user_of_record_name", "created_at", "model_id", "user_of_record_id") VALUES(E'0.0.0.0', E'200 OK', '2008-03-03 21:20:25.271017', E'post', NULL, 6, E'index', E'FirmController', E'very_privileged', E'very_privileged', '2008-03-03 21:20:25.271017', NULL, 6) SQL (0.000459) SELECT currval('request_log_entries_id_seq') Completed in 0.09754 (10 reqs/sec) | Rendering: 0.07920 (81%) | DB: 0.01522 (15%) | 200 OK [http://test.host/firm?create=1&new_firm%5Bfull_name%5D=&new_firm%5Bname%5D=simpson] Firm Load (0.000948) SELECT * FROM firms WHERE (firms.name = E'simpson') LIMIT 1 Firm Load (0.000741) SELECT * FROM firms WHERE (firms.full_name = E'') LIMIT 1 Firm Load (0.000696) SELECT * FROM firms WHERE (firms."name" = E'simpson') LIMIT 1 SQL (0.000832) ROLLBACK SQL (0.000674) BEGIN User Load (0.001901) SELECT * FROM users WHERE (users."id" = 6) Firm Load (0.001741) SELECT * FROM firms WHERE (firms."id" = 1) Processing FirmController#index (for 0.0.0.0 at 2008-03-03 21:20:25) [POST] Session ID: Parameters: {"action"=>"index", "destroy"=>{"1"=>1}, "controller"=>"firm"} User Load (0.000959) SELECT * FROM users WHERE (users."id" = 6) CACHE (0.000000) SELECT * FROM users WHERE (users."id" = 6) Firm Load (0.001374) SELECT * FROM firms WHERE (firms."id" = 1) Permission Load (0.001735) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 6 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: destroy Firm Shire(1) Firm Destroy (0.004170) DELETE FROM firms WHERE "id" = 1 Redirected to http://test.host/firm RequestLogEntry Create (0.002220) INSERT INTO request_log_entries ("remote_ip", "status", "updated_at", "http_method", "model_class", "acting_user_id", "action", "controller", "acting_user_name", "user_of_record_name", "created_at", "model_id", "user_of_record_id") VALUES(E'0.0.0.0', E'302 Found', '2008-03-03 21:20:25.318960', E'post', NULL, 6, E'index', E'FirmController', E'very_privileged', E'very_privileged', '2008-03-03 21:20:25.318960', NULL, 6) SQL (0.001077) SELECT currval('request_log_entries_id_seq') PcheckLogEntry Create (0.001093) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(3, '2008-03-03 21:20:25.332236', E'Firm', 't', 6, E'very_privileged', '2008-03-03 21:20:25.332236', 1, E'destroy') SQL (0.000466) SELECT currval('pcheck_log_entries_id_seq') Completed in 0.03925 (25 reqs/sec) | DB: 0.02063 (52%) | 302 Found [http://test.host/firm?destroy%5B1%5D=1] Firm Load (0.000933) SELECT * FROM firms WHERE (firms."id" = 1) LIMIT 1 SQL (0.000452) ROLLBACK SQL (0.000294) BEGIN User Load (0.000844) SELECT * FROM users WHERE (users."id" = 6) Firm Load (0.000801) SELECT * FROM firms WHERE (firms."id" = 1) Processing FirmController#administer (for 0.0.0.0 at 2008-03-03 21:20:25) [GET] Session ID: Parameters: {"action"=>"administer", "id"=>"1", "controller"=>"firm"} User Load (0.000835) SELECT * FROM users WHERE (users."id" = 6) CACHE (0.000000) SELECT * FROM users WHERE (users."id" = 6) Firm Load (0.000631) SELECT * FROM firms WHERE (firms."id" = 1) Rendering template within layouts/admin Rendering firm/administer Permission Load (0.001752) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 6 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) RequestLogEntry Create (0.002280) INSERT INTO request_log_entries ("remote_ip", "status", "updated_at", "http_method", "model_class", "acting_user_id", "action", "controller", "acting_user_name", "user_of_record_name", "created_at", "model_id", "user_of_record_id") VALUES(E'0.0.0.0', E'200 OK', '2008-03-03 21:20:25.372283', E'get', NULL, 6, E'administer', E'FirmController', E'very_privileged', E'very_privileged', '2008-03-03 21:20:25.372283', NULL, 6) SQL (0.001084) SELECT currval('request_log_entries_id_seq') Completed in 0.03694 (27 reqs/sec) | Rendering: 0.01756 (47%) | DB: 0.00991 (26%) | 200 OK [http://test.host/firm/administer/1] SQL (0.001469) ROLLBACK SQL (0.000780) BEGIN User Load (0.002081) SELECT * FROM users WHERE (users."id" = 6) Processing FirmController#index (for 0.0.0.0 at 2008-03-03 21:20:25) [GET] Session ID: Parameters: {"action"=>"index", "controller"=>"firm"} User Load (0.000908) SELECT * FROM users WHERE (users."id" = 6) CACHE (0.000000) SELECT * FROM users WHERE (users."id" = 6) Rendering template within layouts/admin Rendering firm/index SQL (0.000799) SELECT count(*) AS count_all FROM firms Firm Load (0.000613) SELECT * FROM firms Permission Load (0.001513) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 6 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) CACHE (0.000000) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 6 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) RequestLogEntry Create (0.001032) INSERT INTO request_log_entries ("remote_ip", "status", "updated_at", "http_method", "model_class", "acting_user_id", "action", "controller", "acting_user_name", "user_of_record_name", "created_at", "model_id", "user_of_record_id") VALUES(E'0.0.0.0', E'200 OK', '2008-03-03 21:20:25.442357', E'get', NULL, 6, E'index', E'FirmController', E'very_privileged', E'very_privileged', '2008-03-03 21:20:25.442357', NULL, 6) SQL (0.000599) SELECT currval('request_log_entries_id_seq') Completed in 0.05126 (19 reqs/sec) | Rendering: 0.03846 (75%) | DB: 0.00979 (19%) | 200 OK [http://test.host/firm] SQL (0.001047) ROLLBACK SQL (0.000694) BEGIN User Load (0.001855) SELECT * FROM users WHERE (users."id" = 6) Firm Load (0.001647) SELECT * FROM firms WHERE (firms."id" = 1) Processing FirmController#administer (for 0.0.0.0 at 2008-03-03 21:20:25) [POST] Session ID: Parameters: {"firm"=>{"password_lifetime_days"=>"[FILTERED]"}, "action"=>"administer", "id"=>"1", "controller"=>"firm"} User Load (0.002511) SELECT * FROM users WHERE (users."id" = 6) CACHE (0.000000) SELECT * FROM users WHERE (users."id" = 6) Firm Load (0.000845) SELECT * FROM firms WHERE (firms."id" = 1) Firm Load (0.001276) SELECT * FROM firms WHERE (firms.name = E'Shire' AND firms.id <> 1) LIMIT 1 Firm Load (0.001102) SELECT * FROM firms WHERE (firms.full_name = E'Bank of the Shire' AND firms.id <> 1) LIMIT 1 Rendering template within layouts/admin Rendering firm/administer Permission Load (0.002927) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 6 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) RequestLogEntry Create (0.002031) INSERT INTO request_log_entries ("remote_ip", "status", "updated_at", "http_method", "model_class", "acting_user_id", "action", "controller", "acting_user_name", "user_of_record_name", "created_at", "model_id", "user_of_record_id") VALUES(E'0.0.0.0', E'200 OK', '2008-03-03 21:20:25.497626', E'post', NULL, 6, E'administer', E'FirmController', E'very_privileged', E'very_privileged', '2008-03-03 21:20:25.497626', NULL, 6) SQL (0.002633) SELECT currval('request_log_entries_id_seq') Completed in 0.03848 (25 reqs/sec) | Rendering: 0.01156 (30%) | DB: 0.01857 (48%) | 200 OK [http://test.host/firm/administer/1?firm%5Bpassword_lifetime_days%5D=-2] SQL (0.000580) ROLLBACK SQL (0.000306) BEGIN User Load (0.000803) SELECT * FROM users WHERE (users."id" = 6) Firm Load (0.000596) SELECT * FROM firms WHERE (firms."id" = 1) Processing FirmController#administer (for 0.0.0.0 at 2008-03-03 21:20:25) [POST] Session ID: Parameters: {"firm"=>{"password_lifetime_days"=>"[FILTERED]"}, "action"=>"administer", "id"=>"1", "controller"=>"firm"} User Load (0.000941) SELECT * FROM users WHERE (users."id" = 6) CACHE (0.000000) SELECT * FROM users WHERE (users."id" = 6) Firm Load (0.000828) SELECT * FROM firms WHERE (firms."id" = 1) Firm Load (0.000978) SELECT * FROM firms WHERE (firms.name = E'Shire' AND firms.id <> 1) LIMIT 1 Firm Load (0.001170) SELECT * FROM firms WHERE (firms.full_name = E'Bank of the Shire' AND firms.id <> 1) LIMIT 1 Permission Load (0.003828) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 6 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: update Firm Shire(1) Firm Update (0.001470) UPDATE firms SET "created_at" = '2006-10-31 00:00:00.000000', "max_bad_logins" = NULL, "bad_login_dead_minutes" = NULL, "search_name" = E'shire', "name" = E'Shire', "password_lifetime_days" = 56, "full_name" = E'Bank of the Shire', "updated_at" = '2008-03-03 21:20:25.550954' WHERE "id" = 1 Redirected to http://test.host/firm/administer/1 RequestLogEntry Create (0.000984) INSERT INTO request_log_entries ("remote_ip", "status", "updated_at", "http_method", "model_class", "acting_user_id", "action", "controller", "acting_user_name", "user_of_record_name", "created_at", "model_id", "user_of_record_id") VALUES(E'0.0.0.0', E'302 Found', '2008-03-03 21:20:25.567824', E'post', NULL, 6, E'administer', E'FirmController', E'very_privileged', E'very_privileged', '2008-03-03 21:20:25.567824', NULL, 6) SQL (0.000481) SELECT currval('request_log_entries_id_seq') PcheckLogEntry Create (0.000925) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(7, '2008-03-03 21:20:25.574167', E'Firm', 't', 6, E'very_privileged', '2008-03-03 21:20:25.574167', 1, E'update') SQL (0.000404) SELECT currval('pcheck_log_entries_id_seq') Completed in 0.03691 (27 reqs/sec) | DB: 0.01429 (38%) | 302 Found [http://test.host/firm/administer/1?firm%5Bpassword_lifetime_days%5D=56] Firm Load (0.000869) SELECT * FROM firms WHERE (firms."id" = 1) SQL (0.000425) ROLLBACK SQL (0.000410) BEGIN User Load (0.002363) SELECT * FROM users WHERE (users."id" = 6) Firm Load (0.001810) SELECT * FROM firms WHERE (firms."id" = 1) Processing FirmController#index (for 0.0.0.0 at 2008-03-03 21:20:25) [POST] Session ID: Parameters: {"action"=>"index", "controller"=>"firm", "administer"=>{"1"=>1}} User Load (0.002236) SELECT * FROM users WHERE (users."id" = 6) CACHE (0.000000) SELECT * FROM users WHERE (users."id" = 6) Redirected to http://test.host/firm/administer/1 RequestLogEntry Create (0.000913) INSERT INTO request_log_entries ("remote_ip", "status", "updated_at", "http_method", "model_class", "acting_user_id", "action", "controller", "acting_user_name", "user_of_record_name", "created_at", "model_id", "user_of_record_id") VALUES(E'0.0.0.0', E'302 Found', '2008-03-03 21:20:25.605930', E'post', NULL, 6, E'index', E'FirmController', E'very_privileged', E'very_privileged', '2008-03-03 21:20:25.605930', NULL, 6) SQL (0.000429) SELECT currval('request_log_entries_id_seq') Completed in 0.01249 (80 reqs/sec) | DB: 0.00946 (75%) | 302 Found [http://test.host/firm?administer%5B1%5D=1] SQL (0.000476) ROLLBACK SQL (0.000299) BEGIN User Load (0.000913) SELECT * FROM users WHERE (users."id" = 4) Processing LogEntriesController#index (for 0.0.0.0 at 2008-03-03 21:20:25) [GET] Session ID: Parameters: {"action"=>"index", "controller"=>"log_entries", "user_id"=>"4"} User Load (0.000923) SELECT * FROM users WHERE (users."id" = 4) CACHE (0.000000) SELECT * FROM users WHERE (users."id" = 4) CACHE (0.000000) SELECT * FROM users WHERE (users."id" = 4) Permission Load (0.002500) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 4 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: administer User ricky(4) RequestLogEntry Load (0.004996) SELECT * FROM request_log_entries WHERE (user_of_record_id = 4) ORDER BY created_at DESC LIMIT 5 OFFSET 0 Rendering template within layouts/admin Rendering log_entries/index CACHE (0.000000) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 4 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) RequestLogEntry Create (0.001004) INSERT INTO request_log_entries ("remote_ip", "status", "updated_at", "http_method", "model_class", "acting_user_id", "action", "controller", "acting_user_name", "user_of_record_name", "created_at", "model_id", "user_of_record_id") VALUES(E'0.0.0.0', E'200 OK', '2008-03-03 21:20:25.671854', E'get', NULL, 4, E'index', E'LogEntriesController', E'ricky', E'ricky', '2008-03-03 21:20:25.671854', NULL, 4) SQL (0.000434) SELECT currval('request_log_entries_id_seq') PcheckLogEntry Create (0.002183) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(9, '2008-03-03 21:20:25.677960', E'User', 't', 4, E'ricky', '2008-03-03 21:20:25.677960', 4, E'administer') SQL (0.000970) SELECT currval('pcheck_log_entries_id_seq') Completed in 0.06791 (14 reqs/sec) | Rendering: 0.02326 (34%) | DB: 0.01470 (21%) | 200 OK [http://test.host/users/4/log_entries] Processing LogEntriesController#index (for 0.0.0.0 at 2008-03-03 21:20:25) [GET] Session ID: Parameters: {"action"=>"index", "controller"=>"log_entries", "offset"=>"2", "user_id"=>"4"} User Load (0.002219) SELECT * FROM users WHERE (users."id" = 4) CACHE (0.000000) SELECT * FROM users WHERE (users."id" = 4) CACHE (0.000000) SELECT * FROM users WHERE (users."id" = 4) Permission Load (0.004375) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 4 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: administer User ricky(4) RequestLogEntry Load (0.001064) SELECT * FROM request_log_entries WHERE (user_of_record_id = 4) ORDER BY created_at DESC LIMIT 5 OFFSET 2 Rendering template within layouts/admin Rendering log_entries/index CACHE (0.000000) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 4 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) RequestLogEntry Create (0.000931) INSERT INTO request_log_entries ("remote_ip", "status", "updated_at", "http_method", "model_class", "acting_user_id", "action", "controller", "acting_user_name", "user_of_record_name", "created_at", "model_id", "user_of_record_id") VALUES(E'0.0.0.0', E'200 OK', '2008-03-03 21:20:25.735724', E'get', NULL, 4, E'index', E'LogEntriesController', E'ricky', E'ricky', '2008-03-03 21:20:25.735724', NULL, 4) SQL (0.000431) SELECT currval('request_log_entries_id_seq') PcheckLogEntry Create (0.000961) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(10, '2008-03-03 21:20:25.741947', E'User', 't', 4, E'ricky', '2008-03-03 21:20:25.741947', 4, E'administer') SQL (0.000428) SELECT currval('pcheck_log_entries_id_seq') Completed in 0.05247 (19 reqs/sec) | Rendering: 0.01807 (34%) | DB: 0.01041 (19%) | 200 OK [http://test.host/users/4/log_entries] SQL (0.000516) ROLLBACK SQL (0.000307) BEGIN User Load (0.001799) SELECT * FROM users WHERE (users."id" = 4) PcheckLogEntry Load (0.002250) SELECT * FROM pcheck_log_entries LIMIT 1 SQL (0.000827) ROLLBACK SQL (0.000364) BEGIN User Load (0.000897) SELECT * FROM users WHERE (users."id" = 4) Store Load (0.000941) SELECT * FROM stores WHERE (stores."id" = 2) Offer Load (0.000940) SELECT * FROM offers WHERE (offers."id" = 1) Processing OffersController#place_order (for 0.0.0.0 at 2008-03-03 21:20:25) [PUT] Session ID: Parameters: {"action"=>"place_order", "id"=>"1", "controller"=>"offers", "store_id"=>"2"} User Load (0.001526) SELECT * FROM users WHERE (users."id" = 4) CACHE (0.000000) SELECT * FROM users WHERE (users."id" = 4) Store Load (0.000767) SELECT * FROM stores WHERE (stores."id" = 2) Offer Load (0.000910) SELECT * FROM offers WHERE (offers."id" = 1) CACHE (0.000000) SELECT * FROM stores WHERE (stores."id" = 2) Firm Load (0.001915) SELECT * FROM firms WHERE (firms."id" = 3) Permission Load (0.002114) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 4 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: place Order X() PK and serial sequence (0.006088) SELECT attr.attname, seq.relname FROM pg_class seq, pg_attribute attr, pg_depend dep, pg_namespace name, pg_constraint cons WHERE seq.oid = dep.objid AND seq.relkind = 'S' AND attr.attrelid = dep.refobjid AND attr.attnum = dep.refobjsubid AND attr.attrelid = cons.conrelid AND attr.attnum = cons.conkey[1] AND cons.contype = 'p' AND dep.refobjid = 'orders'::regclass Order Create (0.001043) INSERT INTO orders ("shipped", "updated_at", "notes", "owner_firm_id", "paid", "owner_id", "shipping_address", "store_id", "payment_authenticator", "created_at") VALUES('f', '2008-03-03 21:20:25.799378', NULL, 3, 'f', 4, NULL, 2, NULL, '2008-03-03 21:20:25.799378') SQL (0.000419) SELECT currval('orders_id_seq') LineItem Load (0.002700) SELECT * FROM line_items WHERE (line_items.order_id = 3) AND (line_items."offer_id" = 1) LIMIT 1 === permission check: edit Order X(3) Firm Load (0.000927) SELECT * FROM firms WHERE (firms."id" = 3) SQL (0.002551) select 'x' from orders where id = 3 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 4 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'edit' or p.privilege = 'any') and (p.class_name = E'Order') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or orders.owner_id = 4) and (p.target_id is null or orders.id = p.target_id) and (p.target_owner_id is null or orders.owner_id = p.target_owner_id) and (p.target_paid is null or orders.paid = p.target_paid) ) === permission check: edit Order X(3) === permission check: edit Order X(3) PK and serial sequence (0.045980) SELECT attr.attname, seq.relname FROM pg_class seq, pg_attribute attr, pg_depend dep, pg_namespace name, pg_constraint cons WHERE seq.oid = dep.objid AND seq.relkind = 'S' AND attr.attrelid = dep.refobjid AND attr.attnum = dep.refobjsubid AND attr.attrelid = cons.conrelid AND attr.attnum = cons.conkey[1] AND cons.contype = 'p' AND dep.refobjid = 'line_items'::regclass LineItem Create (0.001105) INSERT INTO line_items ("offer_id", "order_id", "quantity") VALUES(1, 3, 1) SQL (0.002010) SELECT currval('line_items_id_seq') Redirected to http://test.host/orders/3 RequestLogEntry Create (0.001062) INSERT INTO request_log_entries ("remote_ip", "status", "updated_at", "http_method", "model_class", "acting_user_id", "action", "controller", "acting_user_name", "user_of_record_name", "created_at", "model_id", "user_of_record_id") VALUES(E'0.0.0.0', E'302 Found', '2008-03-03 21:20:26.066042', E'put', NULL, 4, E'place_order', E'OffersController', E'ricky', E'ricky', '2008-03-03 21:20:26.066042', NULL, 4) SQL (0.000431) SELECT currval('request_log_entries_id_seq') PcheckLogEntry Create (0.001046) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(11, '2008-03-03 21:20:26.072568', E'Order', 't', 4, E'ricky', '2008-03-03 21:20:26.072568', NULL, E'place') SQL (0.000472) SELECT currval('pcheck_log_entries_id_seq') PcheckLogEntry Create (0.000935) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(11, '2008-03-03 21:20:26.078121', E'Order', 't', 4, E'ricky', '2008-03-03 21:20:26.078121', 3, E'edit') SQL (0.000437) SELECT currval('pcheck_log_entries_id_seq') PcheckLogEntry Create (0.001381) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(11, '2008-03-03 21:20:26.083351', E'Order', 't', 4, E'ricky', '2008-03-03 21:20:26.083351', 3, E'edit') SQL (0.000416) SELECT currval('pcheck_log_entries_id_seq') PcheckLogEntry Create (0.000865) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(11, '2008-03-03 21:20:26.089821', E'Order', 't', 4, E'ricky', '2008-03-03 21:20:26.089821', 3, E'edit') SQL (0.000459) SELECT currval('pcheck_log_entries_id_seq') PcheckLogEntry Create (0.000961) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(11, '2008-03-03 21:20:26.095061', E'Order', 't', 4, E'ricky', '2008-03-03 21:20:26.095061', 3, E'edit') SQL (0.000455) SELECT currval('pcheck_log_entries_id_seq') Completed in 0.32940 (3 reqs/sec) | DB: 0.08782 (26%) | 302 Found [http://test.host/stores/2/offers/1/place_order] SQL (0.000844) SELECT count(*) AS count_all FROM line_items WHERE (line_items.order_id = 3) LineItem Load (0.000724) SELECT * FROM line_items WHERE (line_items.order_id = 3) LIMIT 1 Offer Load (0.000678) SELECT * FROM offers WHERE (offers."id" = 1) Processing OffersController#place_order (for 0.0.0.0 at 2008-03-03 21:20:25) [PUT] Session ID: Parameters: {"action"=>"place_order", "id"=>"1", "controller"=>"offers", "store_id"=>"2"} User Load (0.002240) SELECT * FROM users WHERE (users."id" = 4) CACHE (0.000000) SELECT * FROM users WHERE (users."id" = 4) Offer Load (0.001838) SELECT * FROM offers WHERE (offers."id" = 1) Store Load (0.001463) SELECT * FROM stores WHERE (stores."id" = 2) Order Load (0.002310) SELECT * FROM orders WHERE (orders."id" = 3) Permission Load (0.005352) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 4 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: find Order X(3) LineItem Load (0.000931) SELECT * FROM line_items WHERE (line_items.order_id = 3) AND (line_items."offer_id" = 1) LIMIT 1 CACHE (0.000000) SELECT * FROM orders WHERE (orders."id" = 3) === permission check: find Order X(3) === permission check: edit Order X(3) === permission check: edit Order X(3) CACHE (0.000000) SELECT * FROM offers WHERE (offers."id" = 1) LineItem Update (0.003435) UPDATE line_items SET "order_id" = 3, "offer_id" = 1, "quantity" = 2 WHERE "id" = 3 Redirected to http://test.host/orders/3 RequestLogEntry Create (0.002365) INSERT INTO request_log_entries ("remote_ip", "status", "updated_at", "http_method", "model_class", "acting_user_id", "action", "controller", "acting_user_name", "user_of_record_name", "created_at", "model_id", "user_of_record_id") VALUES(E'0.0.0.0', E'302 Found', '2008-03-03 21:20:26.172643', E'put', NULL, 4, E'place_order', E'OffersController', E'ricky', E'ricky', '2008-03-03 21:20:26.172643', NULL, 4) SQL (0.000998) SELECT currval('request_log_entries_id_seq') PcheckLogEntry Create (0.003225) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(12, '2008-03-03 21:20:26.189859', E'Order', 't', 4, E'ricky', '2008-03-03 21:20:26.189859', 3, E'find') SQL (0.001002) SELECT currval('pcheck_log_entries_id_seq') PcheckLogEntry Create (0.002125) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(12, '2008-03-03 21:20:26.203410', E'Order', 't', 4, E'ricky', '2008-03-03 21:20:26.203410', 3, E'find') SQL (0.001007) SELECT currval('pcheck_log_entries_id_seq') PcheckLogEntry Create (0.001095) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(12, '2008-03-03 21:20:26.213935', E'Order', 't', 4, E'ricky', '2008-03-03 21:20:26.213935', 3, E'edit') SQL (0.000470) SELECT currval('pcheck_log_entries_id_seq') PcheckLogEntry Create (0.000991) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(12, '2008-03-03 21:20:26.219478', E'Order', 't', 4, E'ricky', '2008-03-03 21:20:26.219478', 3, E'edit') SQL (0.000487) SELECT currval('pcheck_log_entries_id_seq') Completed in 0.11489 (8 reqs/sec) | DB: 0.03358 (29%) | 302 Found [http://test.host/stores/2/offers/1/place_order] LineItem Load (0.000814) SELECT * FROM line_items WHERE (line_items."id" = 3) SQL (0.000498) ROLLBACK SQL (0.000301) BEGIN User Load (0.000761) SELECT * FROM users WHERE (users."id" = 4) SQL (0.000562) SELECT count(*) AS count_all FROM offers Store Load (0.000581) SELECT * FROM stores WHERE (stores."id" = 2) Product Load (0.000870) SELECT * FROM products WHERE (products."id" = 1) Processing OffersController#create (for 0.0.0.0 at 2008-03-03 21:20:26) [POST] Session ID: Parameters: {"action"=>"create", "offer"=>{"product_id"=>"1", "discount_pct"=>"25"}, "controller"=>"offers", "store_id"=>"2"} User Load (0.000941) SELECT * FROM users WHERE (users."id" = 4) CACHE (0.000000) SELECT * FROM users WHERE (users."id" = 4) Store Load (0.000820) SELECT * FROM stores WHERE (stores."id" = 2) Permission Load (0.002114) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 4 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: manage_offers Store Ricky's Music Stuff(2) Firm Load (0.002168) SELECT * FROM firms WHERE (firms."id" = 3) SQL (0.005606) select 'x' from stores where id = 2 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 4 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'manage_offers' or p.privilege = 'any') and (p.class_name = E'Store') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or stores.owner_id = 4) and (p.target_owner_id is null or stores.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or stores.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or stores.id = p.target_id) ) SQL (0.005368) select 'x' from products where id = E'1' and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 4 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'offer_for_sale' or p.privilege = 'any') and (p.class_name = E'Product') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or products.owner_id = 4) and (p.target_owner_id is null or products.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or products.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or products.id = p.target_id) ) SQL (0.004688) select 'x' from products where id = E'1' and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 4 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'offer_for_sale' or p.privilege = 'any') and (p.class_name = E'Product') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or products.owner_id = 4) and (p.target_owner_id is null or products.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or products.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or products.id = p.target_id) ) === permission check: manage_offers Store Ricky's Music Stuff(2) === permission check: manage_offers Store Ricky's Music Stuff(2) PK and serial sequence (0.005893) SELECT attr.attname, seq.relname FROM pg_class seq, pg_attribute attr, pg_depend dep, pg_namespace name, pg_constraint cons WHERE seq.oid = dep.objid AND seq.relkind = 'S' AND attr.attrelid = dep.refobjid AND attr.attnum = dep.refobjsubid AND attr.attrelid = cons.conrelid AND attr.attnum = cons.conkey[1] AND cons.contype = 'p' AND dep.refobjid = 'offers'::regclass Offer Create (0.000962) INSERT INTO offers ("product_id", "owner_firm_id", "discount_pct", "owner_id", "store_id") VALUES(1, 3, 25, 4, 2) SQL (0.000424) SELECT currval('offers_id_seq') Redirected to http://test.host/stores/2/offers/4 RequestLogEntry Create (0.001011) INSERT INTO request_log_entries ("remote_ip", "status", "updated_at", "http_method", "model_class", "acting_user_id", "action", "controller", "acting_user_name", "user_of_record_name", "created_at", "model_id", "user_of_record_id") VALUES(E'0.0.0.0', E'302 Found', '2008-03-03 21:20:26.323994', E'post', E'Offer', 4, E'create', E'OffersController', E'ricky', E'ricky', '2008-03-03 21:20:26.323994', 4, 4) SQL (0.000463) SELECT currval('request_log_entries_id_seq') PcheckLogEntry Create (0.000951) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(13, '2008-03-03 21:20:26.330499', E'Store', 't', 4, E'ricky', '2008-03-03 21:20:26.330499', 2, E'manage_offers') SQL (0.000416) SELECT currval('pcheck_log_entries_id_seq') PcheckLogEntry Create (0.000841) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(13, '2008-03-03 21:20:26.335643', E'Store', 't', 4, E'ricky', '2008-03-03 21:20:26.335643', 2, E'manage_offers') SQL (0.000398) SELECT currval('pcheck_log_entries_id_seq') PcheckLogEntry Create (0.002115) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(13, '2008-03-03 21:20:26.342470', E'Product', 't', 4, E'ricky', '2008-03-03 21:20:26.342470', 1, E'offer_for_sale') SQL (0.001136) SELECT currval('pcheck_log_entries_id_seq') PcheckLogEntry Create (0.002209) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(13, '2008-03-03 21:20:26.356463', E'Product', 't', 4, E'ricky', '2008-03-03 21:20:26.356463', 1, E'offer_for_sale') SQL (0.000981) SELECT currval('pcheck_log_entries_id_seq') PcheckLogEntry Create (0.000921) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(13, '2008-03-03 21:20:26.366636', E'Store', 't', 4, E'ricky', '2008-03-03 21:20:26.366636', 2, E'manage_offers') SQL (0.000468) SELECT currval('pcheck_log_entries_id_seq') PcheckLogEntry Create (0.000986) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(13, '2008-03-03 21:20:26.371855', E'Store', 't', 4, E'ricky', '2008-03-03 21:20:26.371855', 2, E'manage_offers') SQL (0.000446) SELECT currval('pcheck_log_entries_id_seq') Completed in 0.13715 (7 reqs/sec) | DB: 0.04671 (34%) | 302 Found [http://test.host/stores/2/offers?offer%5Bdiscount_pct%5D=25&offer%5Bproduct_id%5D=1] SQL (0.000780) SELECT count(*) AS count_all FROM offers SQL (0.001324) ROLLBACK SQL (0.001172) BEGIN User Load (0.002007) SELECT * FROM users WHERE (users."id" = 4) SQL (0.001368) SELECT count(*) AS count_all FROM offers Store Load (0.002467) SELECT * FROM stores WHERE (stores."id" = 2) Processing OffersController#destroy (for 0.0.0.0 at 2008-03-03 21:20:26) [DELETE] Session ID: Parameters: {"action"=>"destroy", "id"=>"1", "controller"=>"offers", "store_id"=>"2"} User Load (0.000964) SELECT * FROM users WHERE (users."id" = 4) CACHE (0.000000) SELECT * FROM users WHERE (users."id" = 4) Store Load (0.001973) SELECT * FROM stores WHERE (stores."id" = 2) Offer Load (0.002072) SELECT * FROM offers WHERE (offers."id" = 1 AND (offers.store_id = 2)) Product Load (0.000901) SELECT * FROM products WHERE (products."id" = 1) Permission Load (0.002075) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 4 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: offer_for_sale Product tenor saxophone(1) CACHE (0.000000) SELECT * FROM stores WHERE (stores."id" = 2) === permission check: manage_offers Store Ricky's Music Stuff(2) === permission check: manage_offers Store Ricky's Music Stuff(2) Offer Destroy (0.001202) DELETE FROM offers WHERE "id" = 1 Redirected to http://test.host/stores/2/offers RequestLogEntry Create (0.000959) INSERT INTO request_log_entries ("remote_ip", "status", "updated_at", "http_method", "model_class", "acting_user_id", "action", "controller", "acting_user_name", "user_of_record_name", "created_at", "model_id", "user_of_record_id") VALUES(E'0.0.0.0', E'302 Found', '2008-03-03 21:20:26.453092', E'delete', E'Offer', 4, E'destroy', E'OffersController', E'ricky', E'ricky', '2008-03-03 21:20:26.453092', 1, 4) SQL (0.000730) SELECT currval('request_log_entries_id_seq') PcheckLogEntry Create (0.002172) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(14, '2008-03-03 21:20:26.461965', E'Product', 't', 4, E'ricky', '2008-03-03 21:20:26.461965', 1, E'offer_for_sale') SQL (0.001056) SELECT currval('pcheck_log_entries_id_seq') PcheckLogEntry Create (0.000914) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(14, '2008-03-03 21:20:26.475494', E'Store', 't', 4, E'ricky', '2008-03-03 21:20:26.475494', 2, E'manage_offers') SQL (0.000404) SELECT currval('pcheck_log_entries_id_seq') PcheckLogEntry Create (0.000796) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(14, '2008-03-03 21:20:26.482056', E'Store', 't', 4, E'ricky', '2008-03-03 21:20:26.482056', 2, E'manage_offers') SQL (0.000546) SELECT currval('pcheck_log_entries_id_seq') Completed in 0.08208 (12 reqs/sec) | DB: 0.02588 (31%) | 302 Found [http://test.host/stores/2/offers/1] SQL (0.000664) SELECT count(*) AS count_all FROM offers SQL (0.001081) ROLLBACK SQL (0.000359) BEGIN User Load (0.000916) SELECT * FROM users WHERE (users."id" = 4) Store Load (0.000626) SELECT * FROM stores WHERE (stores."id" = 2) Processing OffersController#edit (for 0.0.0.0 at 2008-03-03 21:20:26) [GET] Session ID: Parameters: {"action"=>"edit", "id"=>"1", "controller"=>"offers", "store_id"=>"2"} User Load (0.001166) SELECT * FROM users WHERE (users."id" = 4) CACHE (0.000000) SELECT * FROM users WHERE (users."id" = 4) Store Load (0.001032) SELECT * FROM stores WHERE (stores."id" = 2) Offer Load (0.000744) SELECT * FROM offers WHERE (offers."id" = 1 AND (offers.store_id = 2)) Rendering template within layouts/admin Rendering generic_rest/edit Firm Load (0.002202) SELECT * FROM firms WHERE (firms."id" = 3) Product Load (0.006803) SELECT * FROM products WHERE ( exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 4 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'offer_for_sale' or p.privilege = 'any') and (p.class_name = E'Product') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or products.owner_id = 4) and (p.target_owner_id is null or products.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or products.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or products.id = p.target_id) ) ) CACHE (0.000000) SELECT * FROM stores WHERE (stores."id" = 2) Permission Load (0.001997) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 4 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) Rendered offers/_form (0.03179) CACHE (0.000000) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 4 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) RequestLogEntry Create (0.001056) INSERT INTO request_log_entries ("remote_ip", "status", "updated_at", "http_method", "model_class", "acting_user_id", "action", "controller", "acting_user_name", "user_of_record_name", "created_at", "model_id", "user_of_record_id") VALUES(E'0.0.0.0', E'200 OK', '2008-03-03 21:20:26.573489', E'get', E'Offer', 4, E'edit', E'OffersController', E'ricky', E'ricky', '2008-03-03 21:20:26.573489', 1, 4) SQL (0.000448) SELECT currval('request_log_entries_id_seq') Completed in 0.08051 (12 reqs/sec) | Rendering: 0.03863 (47%) | DB: 0.01909 (23%) | 200 OK [http://test.host/stores/2/offers/1/edit] SQL (0.000483) ROLLBACK SQL (0.000303) BEGIN User Load (0.001483) SELECT * FROM users WHERE (users."id" = 4) Store Load (0.000636) SELECT * FROM stores WHERE (stores."id" = 2) Processing OffersController#index (for 0.0.0.0 at 2008-03-03 21:20:26) [GET] Session ID: Parameters: {"action"=>"index", "controller"=>"offers", "store_id"=>"2"} User Load (0.002220) SELECT * FROM users WHERE (users."id" = 4) CACHE (0.000000) SELECT * FROM users WHERE (users."id" = 4) Store Load (0.000897) SELECT * FROM stores WHERE (stores."id" = 2) Offer Load (0.000752) SELECT * FROM offers WHERE (offers.store_id = 2) Rendering template within layouts/admin Rendering generic_rest/index Product Load (0.000914) SELECT * FROM products WHERE (products."id" = 1) Rendered offers/_description (0.00368) CACHE (0.000000) SELECT * FROM stores WHERE (stores."id" = 2) Permission Load (0.002038) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 4 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) Product Load (0.001021) SELECT * FROM products WHERE (products."id" = 3) Rendered offers/_description (0.00247) CACHE (0.000000) SELECT * FROM stores WHERE (stores."id" = 2) Product Load (0.002113) SELECT * FROM products WHERE (products."id" = 2) Rendered offers/_description (0.00535) CACHE (0.000000) SELECT * FROM stores WHERE (stores."id" = 2) CACHE (0.000000) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 4 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) RequestLogEntry Create (0.002286) INSERT INTO request_log_entries ("remote_ip", "status", "updated_at", "http_method", "model_class", "acting_user_id", "action", "controller", "acting_user_name", "user_of_record_name", "created_at", "model_id", "user_of_record_id") VALUES(E'0.0.0.0', E'200 OK', '2008-03-03 21:20:26.748439', E'get', NULL, 4, E'index', E'OffersController', E'ricky', E'ricky', '2008-03-03 21:20:26.748439', NULL, 4) SQL (0.000949) SELECT currval('request_log_entries_id_seq') Completed in 0.16419 (6 reqs/sec) | Rendering: 0.13052 (79%) | DB: 0.01609 (9%) | 200 OK [http://test.host/stores/2/offers] SQL (0.001268) ROLLBACK SQL (0.000808) BEGIN User Load (0.001988) SELECT * FROM users WHERE (users."id" = 4) Store Load (0.001569) SELECT * FROM stores WHERE (stores."id" = 2) Processing OffersController#new (for 0.0.0.0 at 2008-03-03 21:20:26) [GET] Session ID: Parameters: {"action"=>"new", "controller"=>"offers", "store_id"=>"2"} User Load (0.001175) SELECT * FROM users WHERE (users."id" = 4) CACHE (0.000000) SELECT * FROM users WHERE (users."id" = 4) Store Load (0.000846) SELECT * FROM stores WHERE (stores."id" = 2) Permission Load (0.001782) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 4 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: manage_offers Store Ricky's Music Stuff(2) Firm Load (0.001221) SELECT * FROM firms WHERE (firms."id" = 3) SQL (0.002030) select 'x' from stores where id = 2 and exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 4 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'manage_offers' or p.privilege = 'any') and (p.class_name = E'Store') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or stores.owner_id = 4) and (p.target_owner_id is null or stores.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or stores.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or stores.id = p.target_id) ) Rendering template within layouts/admin Rendering generic_rest/new Product Load (0.002330) SELECT * FROM products WHERE ( exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 4 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'offer_for_sale' or p.privilege = 'any') and (p.class_name = E'Product') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or products.owner_id = 4) and (p.target_owner_id is null or products.owner_id = p.target_owner_id) and (p.target_owner_firm_id is null or products.owner_firm_id = p.target_owner_firm_id) and (p.target_id is null or products.id = p.target_id) ) ) Rendered offers/_form (0.00912) CACHE (0.000000) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 4 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) RequestLogEntry Create (0.000964) INSERT INTO request_log_entries ("remote_ip", "status", "updated_at", "http_method", "model_class", "acting_user_id", "action", "controller", "acting_user_name", "user_of_record_name", "created_at", "model_id", "user_of_record_id") VALUES(E'0.0.0.0', E'200 OK', '2008-03-03 21:20:26.837560', E'get', E'Offer', 4, E'new', E'OffersController', E'ricky', E'ricky', '2008-03-03 21:20:26.837560', NULL, 4) SQL (0.000550) SELECT currval('request_log_entries_id_seq') PcheckLogEntry Create (0.001910) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(17, '2008-03-03 21:20:26.843883', E'Store', 't', 4, E'ricky', '2008-03-03 21:20:26.843883', 2, E'manage_offers') SQL (0.001026) SELECT currval('pcheck_log_entries_id_seq') PcheckLogEntry Create (0.002132) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(17, '2008-03-03 21:20:26.854776', E'Store', 't', 4, E'ricky', '2008-03-03 21:20:26.854776', 2, E'manage_offers') SQL (0.001069) SELECT currval('pcheck_log_entries_id_seq') Completed in 0.08004 (12 reqs/sec) | Rendering: 0.02616 (32%) | DB: 0.02267 (28%) | 200 OK [http://test.host/stores/2/offers/new] SQL (0.000890) ROLLBACK SQL (0.000335) BEGIN User Load (0.000842) SELECT * FROM users WHERE (users."id" = 4) Store Load (0.000727) SELECT * FROM stores WHERE (stores."id" = 2) Processing OffersController#show (for 0.0.0.0 at 2008-03-03 21:20:26) [GET] Session ID: Parameters: {"action"=>"show", "id"=>"1", "controller"=>"offers", "store_id"=>"2"} User Load (0.000983) SELECT * FROM users WHERE (users."id" = 4) CACHE (0.000000) SELECT * FROM users WHERE (users."id" = 4) Store Load (0.001840) SELECT * FROM stores WHERE (stores."id" = 2) Offer Load (0.001827) SELECT * FROM offers WHERE (offers."id" = 1 AND (offers.store_id = 2)) Rendering template within layouts/admin Rendering offers/show CACHE (0.000000) SELECT * FROM stores WHERE (stores."id" = 2) Product Load (0.002069) SELECT * FROM products WHERE (products."id" = 1) Firm Load (0.000999) SELECT * FROM firms WHERE (firms."id" = 3) Permission Load (0.001780) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 4 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) CACHE (0.000000) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 4 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) RequestLogEntry Create (0.001054) INSERT INTO request_log_entries ("remote_ip", "status", "updated_at", "http_method", "model_class", "acting_user_id", "action", "controller", "acting_user_name", "user_of_record_name", "created_at", "model_id", "user_of_record_id") VALUES(E'0.0.0.0', E'200 OK', '2008-03-03 21:20:26.939408', E'get', E'Offer', 4, E'show', E'OffersController', E'ricky', E'ricky', '2008-03-03 21:20:26.939408', 1, 4) SQL (0.000448) SELECT currval('request_log_entries_id_seq') Completed in 0.06977 (14 reqs/sec) | Rendering: 0.03619 (51%) | DB: 0.01379 (19%) | 200 OK [http://test.host/stores/2/offers/1] SQL (0.000548) ROLLBACK SQL (0.000795) BEGIN User Load (0.002109) SELECT * FROM users WHERE (users."id" = 4) Store Load (0.001457) SELECT * FROM stores WHERE (stores."id" = 2) Processing OffersController#update (for 0.0.0.0 at 2008-03-03 21:20:26) [PUT] Session ID: Parameters: {"action"=>"update", "id"=>"1", "offer"=>{"discount_pct"=>"25"}, "controller"=>"offers", "store_id"=>"2"} User Load (0.002264) SELECT * FROM users WHERE (users."id" = 4) CACHE (0.000000) SELECT * FROM users WHERE (users."id" = 4) Store Load (0.001882) SELECT * FROM stores WHERE (stores."id" = 2) Offer Load (0.000856) SELECT * FROM offers WHERE (offers."id" = 1 AND (offers.store_id = 2)) CACHE (0.000000) SELECT * FROM stores WHERE (stores."id" = 2) Permission Load (0.001845) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 4 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: manage_offers Store Ricky's Music Stuff(2) === permission check: manage_offers Store Ricky's Music Stuff(2) CACHE (0.000000) SELECT * FROM users WHERE (users."id" = 4) Firm Load (0.002229) SELECT * FROM firms WHERE (firms."id" = 3) === permission check: manage_offers Store Ricky's Music Stuff(2) Offer Update (0.001109) UPDATE offers SET "owner_firm_id" = 3, "owner_id" = 4, "product_id" = 1, "store_id" = 2, "discount_pct" = 25 WHERE "id" = 1 Redirected to http://test.host/stores/2/offers/1 RequestLogEntry Create (0.000937) INSERT INTO request_log_entries ("remote_ip", "status", "updated_at", "http_method", "model_class", "acting_user_id", "action", "controller", "acting_user_name", "user_of_record_name", "created_at", "model_id", "user_of_record_id") VALUES(E'0.0.0.0', E'302 Found', '2008-03-03 21:20:27.022211', E'put', E'Offer', 4, E'update', E'OffersController', E'ricky', E'ricky', '2008-03-03 21:20:27.022211', 1, 4) SQL (0.000420) SELECT currval('request_log_entries_id_seq') PcheckLogEntry Create (0.000793) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(19, '2008-03-03 21:20:27.028275', E'Store', 't', 4, E'ricky', '2008-03-03 21:20:27.028275', 2, E'manage_offers') SQL (0.000401) SELECT currval('pcheck_log_entries_id_seq') PcheckLogEntry Create (0.002221) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(19, '2008-03-03 21:20:27.032964', E'Store', 't', 4, E'ricky', '2008-03-03 21:20:27.032964', 2, E'manage_offers') SQL (0.000984) SELECT currval('pcheck_log_entries_id_seq') PcheckLogEntry Create (0.001832) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(19, '2008-03-03 21:20:27.044014', E'Store', 't', 4, E'ricky', '2008-03-03 21:20:27.044014', 2, E'manage_offers') SQL (0.000410) SELECT currval('pcheck_log_entries_id_seq') Completed in 0.08313 (12 reqs/sec) | DB: 0.02309 (27%) | 302 Found [http://test.host/stores/2/offers/1?offer%5Bdiscount_pct%5D=25] SQL (0.000601) ROLLBACK SQL (0.000395) BEGIN User Load (0.000905) SELECT * FROM users WHERE (users."id" = 4) User Load (0.000953) SELECT * FROM users WHERE (users."id" = 7) Order Load (0.000956) SELECT * FROM orders WHERE (orders."id" = 1) Permission Load (0.001480) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 7 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: find Order X(1) LineItem Load (0.001046) SELECT * FROM line_items WHERE (line_items."id" = 2) Processing OrdersController#edit (for 0.0.0.0 at 2008-03-03 21:20:27) [GET] Session ID: Parameters: {"action"=>"edit", "id"=>#, "controller"=>"orders"} User Load (0.000933) SELECT * FROM users WHERE (users."id" = 4) CACHE (0.000000) SELECT * FROM users WHERE (users."id" = 4) Order Load (0.000930) SELECT * FROM orders WHERE (orders."id" = 1) Permission Load (0.002318) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 4 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: find Order X(1) Rendering template within layouts/admin Rendering generic_rest/edit Store Load (0.001681) SELECT * FROM stores SQL (0.000947) SELECT count(*) AS count_all FROM line_items WHERE (line_items.order_id = 1) LineItem Load (0.000609) SELECT * FROM line_items WHERE (line_items.order_id = 1) CACHE (0.000000) SELECT * FROM orders WHERE (orders."id" = 1) === permission check: find Order X(1) Offer Load (0.002018) SELECT * FROM offers WHERE (offers."id" = 2) Product Load (0.001546) SELECT * FROM products WHERE (products."id" = 2) CACHE (0.000000) SELECT * FROM orders WHERE (orders."id" = 1) === permission check: find Order X(1) Offer Load (0.000914) SELECT * FROM offers WHERE (offers."id" = 3) Product Load (0.001314) SELECT * FROM products WHERE (products."id" = 3) Rendered orders/_form (0.07364) CACHE (0.000000) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 4 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) RequestLogEntry Create (0.001084) INSERT INTO request_log_entries ("remote_ip", "status", "updated_at", "http_method", "model_class", "acting_user_id", "action", "controller", "acting_user_name", "user_of_record_name", "created_at", "model_id", "user_of_record_id") VALUES(E'0.0.0.0', E'200 OK', '2008-03-03 21:20:27.199491', E'get', E'Order', 4, E'edit', E'OrdersController', E'ricky', E'ricky', '2008-03-03 21:20:27.199491', 1, 4) SQL (0.000483) SELECT currval('request_log_entries_id_seq') PcheckLogEntry Create (0.001412) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(20, '2008-03-03 21:20:27.208631', E'Order', 't', 4, E'ricky', '2008-03-03 21:20:27.208631', 1, E'find') SQL (0.000522) SELECT currval('pcheck_log_entries_id_seq') PcheckLogEntry Create (0.002582) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(20, '2008-03-03 21:20:27.215903', E'Order', 't', 4, E'ricky', '2008-03-03 21:20:27.215903', 1, E'find') SQL (0.000993) SELECT currval('pcheck_log_entries_id_seq') PcheckLogEntry Create (0.002022) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(20, '2008-03-03 21:20:27.225662', E'Order', 't', 4, E'ricky', '2008-03-03 21:20:27.225662', 1, E'find') SQL (0.001010) SELECT currval('pcheck_log_entries_id_seq') Completed in 0.16000 (6 reqs/sec) | Rendering: 0.08698 (54%) | DB: 0.02965 (18%) | 200 OK [http://test.host/orders/1/edit] SQL (0.000641) ROLLBACK SQL (0.000310) BEGIN User Load (0.000824) SELECT * FROM users WHERE (users."id" = 4) SQL (0.001104) SELECT count(*) AS count_all FROM orders Store Load (0.001476) SELECT * FROM stores WHERE (stores."id" = 2) Processing OrdersController#create (for 0.0.0.0 at 2008-03-03 21:20:27) [POST] Session ID: Parameters: {"order"=>{"notes"=>"This is a note", "shipping_address"=>"5 Springfield Lane Springfield", "store_id"=>"2"}, "action"=>"create", "controller"=>"orders"} User Load (0.002269) SELECT * FROM users WHERE (users."id" = 4) CACHE (0.000000) SELECT * FROM users WHERE (users."id" = 4) Store Load (0.001292) SELECT * FROM stores WHERE (stores."id" = 2) Firm Load (0.000718) SELECT * FROM firms WHERE (firms."id" = 3) Permission Load (0.001968) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 4 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: place Order X() Order Create (0.001290) INSERT INTO orders ("shipped", "updated_at", "notes", "owner_firm_id", "paid", "owner_id", "shipping_address", "store_id", "payment_authenticator", "created_at") VALUES('f', '2008-03-03 21:20:27.332301', E'This is a note', 3, 'f', 4, E'5 Springfield Lane Springfield', 2, NULL, '2008-03-03 21:20:27.332301') SQL (0.000590) SELECT currval('orders_id_seq') Redirected to http://test.host/orders/4 RequestLogEntry Create (0.002112) INSERT INTO request_log_entries ("remote_ip", "status", "updated_at", "http_method", "model_class", "acting_user_id", "action", "controller", "acting_user_name", "user_of_record_name", "created_at", "model_id", "user_of_record_id") VALUES(E'0.0.0.0', E'302 Found', '2008-03-03 21:20:27.353382', E'post', E'Order', 4, E'create', E'OrdersController', E'ricky', E'ricky', '2008-03-03 21:20:27.353382', 4, 4) SQL (0.000950) SELECT currval('request_log_entries_id_seq') PcheckLogEntry Create (0.000866) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(21, '2008-03-03 21:20:27.363566', E'Order', 't', 4, E'ricky', '2008-03-03 21:20:27.363566', NULL, E'place') SQL (0.000416) SELECT currval('pcheck_log_entries_id_seq') Completed in 0.05511 (18 reqs/sec) | DB: 0.01683 (30%) | 302 Found [http://test.host/orders?order%5Bnotes%5D=This+is+a+note&order%5Bshipping_address%5D=5+Springfield+Lane+Springfield&order%5Bstore_id%5D=2] SQL (0.000734) SELECT count(*) AS count_all FROM orders SQL (0.001434) ROLLBACK SQL (0.000797) BEGIN User Load (0.002060) SELECT * FROM users WHERE (users."id" = 4) Processing OrdersController#destroy (for 0.0.0.0 at 2008-03-03 21:20:27) [DELETE] Session ID: Parameters: {"action"=>"destroy", "id"=>"1", "controller"=>"orders"} User Load (0.044767) SELECT * FROM users WHERE (users."id" = 4) CACHE (0.000000) SELECT * FROM users WHERE (users."id" = 4) Order Load (0.001529) SELECT * FROM orders WHERE (orders."id" = 1) Permission Load (0.002859) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 4 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: find Order X(1) === FAILED permission check: forbidden_operation Order X(1) RequestLogEntry Create (0.001877) INSERT INTO request_log_entries ("remote_ip", "status", "updated_at", "http_method", "model_class", "acting_user_id", "action", "controller", "acting_user_name", "user_of_record_name", "created_at", "model_id", "user_of_record_id") VALUES(E'0.0.0.0', E'UNKNOWN', '2008-03-03 21:20:27.640096', E'delete', E'Order', 4, E'destroy', E'OrdersController', E'ricky', E'ricky', '2008-03-03 21:20:27.640096', 1, 4) SQL (0.000964) SELECT currval('request_log_entries_id_seq') PcheckLogEntry Create (0.001027) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(22, '2008-03-03 21:20:27.651137', E'Order', 't', 4, E'ricky', '2008-03-03 21:20:27.651137', 1, E'find') SQL (0.000489) SELECT currval('pcheck_log_entries_id_seq') PcheckLogEntry Create (0.001075) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(22, '2008-03-03 21:20:27.657049', E'Order', 'f', 4, E'ricky', '2008-03-03 21:20:27.657049', 1, E'forbidden_operation') SQL (0.000421) SELECT currval('pcheck_log_entries_id_seq') SQL (0.000434) ROLLBACK SQL (0.000301) BEGIN User Load (0.000824) SELECT * FROM users WHERE (users."id" = 4) User Load (0.000826) SELECT * FROM users WHERE (users."id" = 7) Order Load (0.000826) SELECT * FROM orders WHERE (orders."id" = 1) Permission Load (0.002537) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 7 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: find Order X(1) Order Load (0.002182) SELECT * FROM orders WHERE (orders."id" = 2) === permission check: find Order X(2) Processing OrdersController#edit (for 0.0.0.0 at 2008-03-03 21:20:27) [GET] Session ID: Parameters: {"action"=>"edit", "id"=>"1", "controller"=>"orders"} User Load (0.001000) SELECT * FROM users WHERE (users."id" = 4) CACHE (0.000000) SELECT * FROM users WHERE (users."id" = 4) Order Load (0.000916) SELECT * FROM orders WHERE (orders."id" = 1) Permission Load (0.001906) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 4 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: find Order X(1) Rendering template within layouts/admin Rendering generic_rest/edit Store Load (0.001857) SELECT * FROM stores SQL (0.002198) SELECT count(*) AS count_all FROM line_items WHERE (line_items.order_id = 1) LineItem Load (0.001461) SELECT * FROM line_items WHERE (line_items.order_id = 1) CACHE (0.000000) SELECT * FROM orders WHERE (orders."id" = 1) === permission check: find Order X(1) Offer Load (0.000936) SELECT * FROM offers WHERE (offers."id" = 2) Product Load (0.001711) SELECT * FROM products WHERE (products."id" = 2) CACHE (0.000000) SELECT * FROM orders WHERE (orders."id" = 1) === permission check: find Order X(1) Offer Load (0.001971) SELECT * FROM offers WHERE (offers."id" = 3) Product Load (0.000766) SELECT * FROM products WHERE (products."id" = 3) Rendered orders/_form (0.07154) CACHE (0.000000) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 4 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) RequestLogEntry Create (0.000945) INSERT INTO request_log_entries ("remote_ip", "status", "updated_at", "http_method", "model_class", "acting_user_id", "action", "controller", "acting_user_name", "user_of_record_name", "created_at", "model_id", "user_of_record_id") VALUES(E'0.0.0.0', E'200 OK', '2008-03-03 21:20:27.794912', E'get', E'Order', 4, E'edit', E'OrdersController', E'ricky', E'ricky', '2008-03-03 21:20:27.794912', 1, 4) SQL (0.000416) SELECT currval('request_log_entries_id_seq') PcheckLogEntry Create (0.001015) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(23, '2008-03-03 21:20:27.804726', E'Order', 't', 4, E'ricky', '2008-03-03 21:20:27.804726', 1, E'find') SQL (0.000472) SELECT currval('pcheck_log_entries_id_seq') PcheckLogEntry Create (0.001035) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(23, '2008-03-03 21:20:27.810611', E'Order', 't', 4, E'ricky', '2008-03-03 21:20:27.810611', 1, E'find') SQL (0.000440) SELECT currval('pcheck_log_entries_id_seq') PcheckLogEntry Create (0.000936) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(23, '2008-03-03 21:20:27.818007', E'Order', 't', 4, E'ricky', '2008-03-03 21:20:27.818007', 1, E'find') SQL (0.000417) SELECT currval('pcheck_log_entries_id_seq') Completed in 0.13357 (7 reqs/sec) | Rendering: 0.07585 (56%) | DB: 0.08836 (66%) | 200 OK [http://test.host/orders/1/edit] Processing OrdersController#edit (for 0.0.0.0 at 2008-03-03 21:20:27) [GET] Session ID: Parameters: {"action"=>"edit", "id"=>"2", "controller"=>"orders"} User Load (0.001986) SELECT * FROM users WHERE (users."id" = 4) CACHE (0.000000) SELECT * FROM users WHERE (users."id" = 4) Order Load (0.001992) SELECT * FROM orders WHERE (orders."id" = 2) Permission Load (0.004455) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 4 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: find Order X(2) Rendering template within layouts/admin Rendering generic_rest/edit Store Load (0.001794) SELECT * FROM stores SQL (0.000852) SELECT count(*) AS count_all FROM line_items WHERE (line_items.order_id = 2) Rendered orders/_form (0.02642) CACHE (0.000000) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 4 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) RequestLogEntry Create (0.001002) INSERT INTO request_log_entries ("remote_ip", "status", "updated_at", "http_method", "model_class", "acting_user_id", "action", "controller", "acting_user_name", "user_of_record_name", "created_at", "model_id", "user_of_record_id") VALUES(E'0.0.0.0', E'200 OK', '2008-03-03 21:20:27.900237', E'get', E'Order', 4, E'edit', E'OrdersController', E'ricky', E'ricky', '2008-03-03 21:20:27.900237', 2, 4) SQL (0.000488) SELECT currval('request_log_entries_id_seq') PcheckLogEntry Create (0.001020) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(24, '2008-03-03 21:20:27.909889', E'Order', 't', 4, E'ricky', '2008-03-03 21:20:27.909889', 2, E'find') SQL (0.000456) SELECT currval('pcheck_log_entries_id_seq') Completed in 0.09023 (11 reqs/sec) | Rendering: 0.04542 (50%) | DB: 0.01405 (15%) | 200 OK [http://test.host/orders/1/edit] SQL (0.000530) ROLLBACK SQL (0.000801) BEGIN User Load (0.001908) SELECT * FROM users WHERE (users."id" = 4) Processing OrdersController#index (for 0.0.0.0 at 2008-03-03 21:20:27) [GET] Session ID: Parameters: {"action"=>"index", "controller"=>"orders"} User Load (0.004296) SELECT * FROM users WHERE (users."id" = 4) CACHE (0.000000) SELECT * FROM users WHERE (users."id" = 4) Firm Load (0.001009) SELECT * FROM firms WHERE (firms."id" = 3) Order Load (0.002479) SELECT * FROM orders WHERE ( exists (select 'x' from permissions p where exists (select 'x' from role_assignments where user_id = 4 and role_assignments.role_id = p.role_id and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) ) and (p.privilege = E'find' or p.privilege = 'any') and (p.class_name = E'Order') and (p.is_grant = 'f') and (p.target_owned_by_self = 'f' or orders.owner_id = 4) and (p.target_id is null or orders.id = p.target_id) and (p.target_owner_id is null or orders.owner_id = p.target_owner_id) and (p.target_paid is null or orders.paid = p.target_paid) ) ) ORDER BY created_at desc Permission Load (0.001892) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 4 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: find Order X(2) === permission check: find Order X(1) Rendering template within layouts/admin Rendering generic_rest/index User Load (0.002438) SELECT * FROM users WHERE (users."id" = 3) Store Load (0.001683) SELECT * FROM stores WHERE (stores."id" = 2) Rendered orders/_description (0.01364) CACHE (0.000000) SELECT * FROM users WHERE (users."id" = 3) CACHE (0.000000) SELECT * FROM stores WHERE (stores."id" = 2) Rendered orders/_description (0.00219) CACHE (0.000000) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 4 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) RequestLogEntry Create (0.002380) INSERT INTO request_log_entries ("remote_ip", "status", "updated_at", "http_method", "model_class", "acting_user_id", "action", "controller", "acting_user_name", "user_of_record_name", "created_at", "model_id", "user_of_record_id") VALUES(E'0.0.0.0', E'200 OK', '2008-03-03 21:20:28.004296', E'get', NULL, 4, E'index', E'OrdersController', E'ricky', E'ricky', '2008-03-03 21:20:28.004296', NULL, 4) SQL (0.001067) SELECT currval('request_log_entries_id_seq') PcheckLogEntry Create (0.001017) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(25, '2008-03-03 21:20:28.016962', E'Order', 't', 4, E'ricky', '2008-03-03 21:20:28.016962', 2, E'find') SQL (0.000436) SELECT currval('pcheck_log_entries_id_seq') PcheckLogEntry Create (0.000914) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(25, '2008-03-03 21:20:28.022243', E'Order', 't', 4, E'ricky', '2008-03-03 21:20:28.022243', 1, E'find') SQL (0.000407) SELECT currval('pcheck_log_entries_id_seq') Completed in 0.09648 (10 reqs/sec) | Rendering: 0.03624 (37%) | DB: 0.02326 (24%) | 200 OK [http://test.host/orders] SQL (0.000519) ROLLBACK SQL (0.000805) BEGIN User Load (0.000804) SELECT * FROM users WHERE (users."id" = 4) Processing OrdersController#new (for 0.0.0.0 at 2008-03-03 21:20:28) [GET] Session ID: Parameters: {"action"=>"new", "controller"=>"orders"} User Load (0.004121) SELECT * FROM users WHERE (users."id" = 4) CACHE (0.000000) SELECT * FROM users WHERE (users."id" = 4) Rendering template within layouts/admin Rendering generic_rest/new Store Load (0.000808) SELECT * FROM stores SQL (0.001840) SELECT count(*) AS count_all FROM line_items WHERE (line_items.order_id = NULL) Rendered orders/_form (0.01004) Permission Load (0.004601) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 4 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) RequestLogEntry Create (0.001107) INSERT INTO request_log_entries ("remote_ip", "status", "updated_at", "http_method", "model_class", "acting_user_id", "action", "controller", "acting_user_name", "user_of_record_name", "created_at", "model_id", "user_of_record_id") VALUES(E'0.0.0.0', E'200 OK', '2008-03-03 21:20:28.090196', E'get', E'Order', 4, E'new', E'OrdersController', E'ricky', E'ricky', '2008-03-03 21:20:28.090196', NULL, 4) SQL (0.000478) SELECT currval('request_log_entries_id_seq') Completed in 0.05837 (17 reqs/sec) | Rendering: 0.03492 (59%) | DB: 0.01508 (25%) | 200 OK [http://test.host/orders/new] SQL (0.000492) ROLLBACK SQL (0.000297) BEGIN User Load (0.000789) SELECT * FROM users WHERE (users."id" = 4) User Load (0.000760) SELECT * FROM users WHERE (users."id" = 7) Order Load (0.001520) SELECT * FROM orders WHERE (orders."id" = 1) Permission Load (0.005094) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 7 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: find Order X(1) Order Load (0.000931) SELECT * FROM orders WHERE (orders."id" = 2) === permission check: find Order X(2) Processing OrdersController#show (for 0.0.0.0 at 2008-03-03 21:20:28) [GET] Session ID: Parameters: {"action"=>"show", "id"=>"1", "controller"=>"orders"} User Load (0.001078) SELECT * FROM users WHERE (users."id" = 4) CACHE (0.000000) SELECT * FROM users WHERE (users."id" = 4) Order Load (0.001710) SELECT * FROM orders WHERE (orders."id" = 1) Permission Load (0.004257) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 4 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: find Order X(1) Rendering template within layouts/admin Rendering orders/show User Load (0.000980) SELECT * FROM users WHERE (users."id" = 3) Store Load (0.000669) SELECT * FROM stores WHERE (stores."id" = 2) SQL (0.000590) SELECT count(*) AS count_all FROM line_items WHERE (line_items.order_id = 1) LineItem Load (0.000527) SELECT * FROM line_items WHERE (line_items.order_id = 1) Offer Load (0.000873) SELECT * FROM offers WHERE (offers."id" = 2) Product Load (0.001366) SELECT * FROM products WHERE (products."id" = 2) Offer Load (0.001400) SELECT * FROM offers WHERE (offers."id" = 3) Product Load (0.000738) SELECT * FROM products WHERE (products."id" = 3) CACHE (0.000000) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 4 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) RequestLogEntry Create (0.002299) INSERT INTO request_log_entries ("remote_ip", "status", "updated_at", "http_method", "model_class", "acting_user_id", "action", "controller", "acting_user_name", "user_of_record_name", "created_at", "model_id", "user_of_record_id") VALUES(E'0.0.0.0', E'200 OK', '2008-03-03 21:20:28.188457', E'get', E'Order', 4, E'show', E'OrdersController', E'ricky', E'ricky', '2008-03-03 21:20:28.188457', 1, 4) SQL (0.000983) SELECT currval('request_log_entries_id_seq') PcheckLogEntry Create (0.002079) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(27, '2008-03-03 21:20:28.200237', E'Order', 't', 4, E'ricky', '2008-03-03 21:20:28.200237', 1, E'find') SQL (0.001032) SELECT currval('pcheck_log_entries_id_seq') Completed in 0.08727 (11 reqs/sec) | Rendering: 0.03002 (34%) | DB: 0.03046 (34%) | 200 OK [http://test.host/orders/1] Processing OrdersController#show (for 0.0.0.0 at 2008-03-03 21:20:28) [GET] Session ID: Parameters: {"action"=>"show", "id"=>"2", "controller"=>"orders"} User Load (0.002168) SELECT * FROM users WHERE (users."id" = 4) CACHE (0.000000) SELECT * FROM users WHERE (users."id" = 4) Order Load (0.002000) SELECT * FROM orders WHERE (orders."id" = 2) Permission Load (0.003130) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 4 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: find Order X(2) Rendering template within layouts/admin Rendering orders/show User Load (0.001017) SELECT * FROM users WHERE (users."id" = 3) Store Load (0.000672) SELECT * FROM stores WHERE (stores."id" = 2) SQL (0.000622) SELECT count(*) AS count_all FROM line_items WHERE (line_items.order_id = 2) CACHE (0.000000) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 4 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) RequestLogEntry Create (0.000999) INSERT INTO request_log_entries ("remote_ip", "status", "updated_at", "http_method", "model_class", "acting_user_id", "action", "controller", "acting_user_name", "user_of_record_name", "created_at", "model_id", "user_of_record_id") VALUES(E'0.0.0.0', E'200 OK', '2008-03-03 21:20:28.262746', E'get', E'Order', 4, E'show', E'OrdersController', E'ricky', E'ricky', '2008-03-03 21:20:28.262746', 2, 4) SQL (0.000481) SELECT currval('request_log_entries_id_seq') PcheckLogEntry Create (0.000984) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(28, '2008-03-03 21:20:28.272870', E'Order', 't', 4, E'ricky', '2008-03-03 21:20:28.272870', 2, E'find') SQL (0.000443) SELECT currval('pcheck_log_entries_id_seq') Completed in 0.06347 (15 reqs/sec) | Rendering: 0.02076 (32%) | DB: 0.01252 (19%) | 200 OK [http://test.host/orders/1] SQL (0.000591) ROLLBACK SQL (0.000327) BEGIN User Load (0.000829) SELECT * FROM users WHERE (users."id" = 4) User Load (0.000759) SELECT * FROM users WHERE (users."id" = 7) Order Load (0.000634) SELECT * FROM orders WHERE (orders."id" = 1) Permission Load (0.001146) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 7 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: find Order X(1) Order Load (0.000755) SELECT * FROM orders WHERE (orders."id" = 2) === permission check: find Order X(2) Store Load (0.003909) SELECT * FROM stores WHERE (stores."id" = 2) Processing OrdersController#update (for 0.0.0.0 at 2008-03-03 21:20:28) [PUT] Session ID: Parameters: {"order"=>{"notes"=>"This is a note", "shipping_address"=>"5 Springfield Lane Springfield", "store_id"=>"2"}, "action"=>"update", "id"=>"1", "controller"=>"orders"} User Load (0.001029) SELECT * FROM users WHERE (users."id" = 4) CACHE (0.000000) SELECT * FROM users WHERE (users."id" = 4) Order Load (0.000917) SELECT * FROM orders WHERE (orders."id" = 1) Permission Load (0.001843) SELECT * FROM permissions WHERE (role_id in (select role_id from role_assignments where user_id = 4 and (role_assignments.invalid_after is null or role_assignments.invalid_after > now()) )) === permission check: find Order X(1) === permission check: administer Order X(1) === permission check: administer Order X(1) === permission check: edit Order X(1) === permission check: edit Order X(1) User Load (0.000978) SELECT * FROM users WHERE (users."id" = 3) Firm Load (0.002399) SELECT * FROM firms WHERE (firms."id" = 3) Order Update (0.002894) UPDATE orders SET "created_at" = '2006-10-31 00:00:00.000000', "owner_firm_id" = 3, "payment_authenticator" = NULL, "owner_id" = 3, "store_id" = 2, "shipping_address" = E'5 Springfield Lane Springfield', "notes" = E'This is a note', "paid" = 'f', "updated_at" = '2008-03-03 21:20:28.355589', "shipped" = 'f' WHERE "id" = 1 Redirected to http://test.host/orders/1 RequestLogEntry Create (0.000935) INSERT INTO request_log_entries ("remote_ip", "status", "updated_at", "http_method", "model_class", "acting_user_id", "action", "controller", "acting_user_name", "user_of_record_name", "created_at", "model_id", "user_of_record_id") VALUES(E'0.0.0.0', E'302 Found', '2008-03-03 21:20:28.366644', E'put', E'Order', 4, E'update', E'OrdersController', E'ricky', E'ricky', '2008-03-03 21:20:28.366644', 1, 4) SQL (0.000407) SELECT currval('request_log_entries_id_seq') PcheckLogEntry Create (0.000986) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(29, '2008-03-03 21:20:28.372827', E'Order', 't', 4, E'ricky', '2008-03-03 21:20:28.372827', 1, E'find') SQL (0.000747) SELECT currval('pcheck_log_entries_id_seq') PcheckLogEntry Create (0.000958) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(29, '2008-03-03 21:20:28.379108', E'Order', 't', 4, E'ricky', '2008-03-03 21:20:28.379108', 1, E'administer') SQL (0.000478) SELECT currval('pcheck_log_entries_id_seq') PcheckLogEntry Create (0.000794) INSERT INTO pcheck_log_entries ("request_log_entry_id", "updated_at", "model_class", "success", "user_id", "user_name", "created_at", "model_id", "privilege") VALUES(29, '2008-03-03 21:20:28.384490', E'Order', 't', 4, E'ricky', '2008-03-03 21: