Page 1 of 1

How to automatically add a user group to a parent/child list

Posted: Wed Dec 24, 2014 5:38 am
by EricZhao
Please see the screenshot attached. It is a list and I have a hook to get a specific user group name. Then I want to have another hook to add this user group to this list. But I'm lack of knowledge how to do this. Can you help? Thanks!

Re: How to automatically add a user group to a parent/child

Posted: Sat Dec 27, 2014 12:36 pm
by Pavel
EricZhao wrote:Please see the screenshot attached. It is a list and I have a hook to get a specific user group name. Then I want to have another hook to add this user group to this list. But I'm lack of knowledge how to do this. Can you help? Thanks!

I am sorry, could you clarify your question, please?
You have a list view control that represents reference_list field on the form, right?
What is the reference list data type?
What do you mean by "hook to get a specific user group name"?

Thank you,
Pavel

Re: How to automatically add a user group to a parent/child

Posted: Mon Dec 29, 2014 4:29 am
by EricZhao
Hi Pavel,

Hope you had a nice Christmas holiday!

I have two record types in CQ: Product and Bug. My goal is to restrict users access to Bugs: every bug has a product, and only users working in this product team have access to bugs of this product.

In User Admin tool, I created user groups for every product separately. For example, user group "Product_A_Security_Group" is for Product A. Only users in this group can view bugs of Product A.

And then in CQ, I added a field "flag" to Product, which type = Reference and references to "Bug". Check the "Security Context" checkbox for this field.

And then in Bug form, there's a new tab called "ratl_security". I can add user group to control the security access.

So far all the steps can be done manually. What I need is to make this process automated when creating a Bug. I.e. when creating a bug, user set a value in Product field (e.g. Product_A), and then the corresponding user group ("Product_A_Security_Group") is automatically added to the "ratl_security" tab. But I don't know how to realize this using hooks. Can you help me?

Thanks!

Eric

Re: How to automatically add a user group to a parent/child

Posted: Mon Dec 29, 2014 9:10 am
by Pavel
Hi,

It suppose to work this way:
1. you can create a stateless record type called "Product"
2. On the "Bug" record type, you should create a REFERENCE field, "Product", which is a reference to the "Product" record type. It should also have "security context" flag checked. It will add "ratl_context_groups" field to the "Product" record type and "Ratl_Security" tab to the record type form.

For each product, you can select ClearQuest user groups that suppose to have access to the product.
Now, when specific product is selected on a "Bug" record, access to this record will be restricted to the correspondent security groups automatically.

Thank you,
Pavel