Opened 6 years ago

Closed 6 years ago

# How does restriction work?

Reported by: Owned by: Chris.Nelson@… walnut normal ChildTicketsPlugin normal 0.11

### Description

ChildTicketsPlugin says it can

• to restrict the type of child-ticket

And I see the example of

[childtickets]
...
parent.enhancement.restrict_child_type = bug-fix, task


But I can't find "restrict" in the code. Is this feature not implemented?

### comment:1 Changed 6 years ago by walnut

• Status changed from new to assigned

### comment:2 follow-up: ↓ 3 Changed 6 years ago by walnut

Hi Chris

Thanks for spotting this....

The 'feature' should be enabled but I took it out some time ago as it has a couple of 'knock-on' questions that were never a concern at my last work place but could be for other organisations. For example:

• If you restrict the child type that a parent type can have and then change the 'type' of a parent (already with children), should that action be allowed? ie. The parent now has 'illegal' children!
• Similarly, if you change the trac.ini file (ie. parent.xxx.restrict_child_type), what happens to all the 'xxx' tickets with children of the wrong type?

I'll remove the documented feature from the wiki page for now and have a think about getting it working properly...

Perhaps the issues are not a problem as anyone using the plugin could simply ignore this feature anyway? Is this a feature that you would see as being useful?

Thanks again Mark

### comment:3 in reply to: ↑ 2 Changed 6 years ago by Chris.Nelson@…

Thanks for spotting this.... ... I'll remove the documented feature from the wiki page for now and have a think about getting it working properly...

Perhaps the issues are not a problem as anyone using the plugin could simply ignore this feature anyway? Is this a feature that you would see as being useful?

I imagine it would be tricky to implement and we're not that fascist about our restrictions. I don't personally have a need or desire for this features. I spotted it when I was porting your fine-grained configuration to SubticketsPlugin and wanted to make sure I'd gotten them all. I realized that 1) I hadn't gotten this one and 2) I couldn't find source for it in ChildTickets, and 3) I couldn't figure out how to do it.

If you're going to take out that doc for your plugin, then I'm done porting. :-)

### comment:4 Changed 6 years ago by walnut

(In [9352]) see #7862

• Re-merged code to allow a restriction on the child type generated.
• If a parent should NOT have children but manages to 'adopt' (ie. children were there before type change for example), then the children ticket list will be visible but it is not possible to create more children (also subsequent edits

svn commit --message

### comment:5 Changed 6 years ago by walnut

Fixes applied in [9352], I shall update the trac-hacks wiki page (with correct info AND a couple of caveats!) and close ticket.

### comment:6 Changed 6 years ago by walnut

• Resolution set to fixed
• Status changed from assigned to closed