Hello, i'm pretty new to symfony. I'm trying to get a "owner" like beahviour on a object/model with sfGuardDoctrinePlugin. What i'm trying to do is to associate a model with a sfGuardGroup like this:
MyModel: columns: some_column: ~ sf_guard_group_id: ~ relations: sfGuardGroup: local: sf_guard_group_id foreign: id type: one so i can give access credentials to MyModel objects only to those users that "own" the object (ie. belong to the associated group) Because in the generated sql the definition of the my_model table comes before the sf_guard_group one I get this error: SQLSTATE[HY000]: General error: 1005 Can't create table './xxxx/ #sql-15cf_f5.frm' (errno: 150). Failing Query: ALTER TABLE my_model ADD FOREIGN KEY (sf_guard_group_id) REFERENCES sf_guard_group(id) ON UPDATE CASCADE ON DELETE CASCADE Now I have two questions: 1. is this the best way to get row level access rights ? 2. how can i cope with automatic sql generation and foreignkey vs table generation order ? Thank you, -d --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---