views:

16

answers:

1

Hi,

In default acegi setting, person and authority have many to many relations. Thus, in addtion to people and authorities, there is a table authotiries-people.

To delete a person (a user) I have to delete the related record in authotiries-people first....then come back to delete the record...

the problem is: other people are still using this authority (ROLE)

could some one enlighten me how to delete the user without deleting the authority?

thanks.

+1  A: 

You have to do something like this...

Authority.findAll().each { 
    it.removeFromPeople(person) 
}
person.delete()

The above removes the relationship between the person and authority first, then deletes the person. The authority itself is never deleted.

tinny