Opened 14 years ago

Last modified 14 years ago

#375 new defect

Don't delete policy records still in use

Reported by: rjl Owned by: rjl
Priority: low Milestone:
Component: PHP scripts Version: 1.0.1
Severity: minor Keywords: delete policy


When a new Maia account is created, an address record is created in the users table, and a corresponding record in the policy table is linked to it. Conversely, when we delete an email address, we also delete the matching policy record. This is fine when the users:policy relationship is 1:1, but in some cases we want users to share a policy record (e.g. the high/medium/low levels). If we later try to delete one of those addresses, we'll end up deleting the policy record it references, even though other addresses still reference it. We basically need to test for any outstanding references to a policy record before deleting it, and leave it alone if there's still at least one record in the users table that points to it.

Change History (2)

comment:1 Changed 14 years ago by dmorton

At the moment I don't think there is any sharing, although I thought I had a todo somewhere to combine the preset levels into a common policy, which would necessitate this ticket.

comment:2 Changed 14 years ago by rjl

Hence the low priority of this ticket. A Maia user has been asking me about a custom hack that involves having his own Perl script add some email aliases directly to the database, and since these are aliases he doesn't see the need for different policies. He was asking whether they could all share the main address's policy record, which makes a certain amount of sense. The only snag I could think of with his strategy was the one raised in this ticket--deletions would risk orphaning any other aliases. This small ticket item seems like a simple, backward-compatible change that would make the users/policy table relationship more robust and pave the way to eventual shared policies for aliases.

Note: See TracTickets for help on using tickets.