cancel
Showing results for 
Search instead for 
Did you mean: 

Move all groups to under a parent group

jonnyg
Confirmed Champ
Confirmed Champ
Expanding on a <a href="https://forums.activiti.org/content/admin-view-all-changes">question I had a few months back</a> – to allow all users to see something, let's get them all in a common group, and then direct users to share to that group.

Seems the easiest way to do that is – suppose our ALL group is 10000, we run this query:

update groups set parent_group_id=10000 where id != 10000 and parent_group_id is null


Tried that. Didn't appear to work; the database is updated, but the groups UI is unchanged.
I even restarted.

Am I missing something here.
7 REPLIES 7

jbarrez
Star Contributor
Star Contributor
That query would update all groups: organisational (like 'sales') and system (like 'report-users').
The latter does not support hierarchical groups, which is probably why it doesn't work for you (I'm assuming your trying to do it for system groups giving capabilities).

Now, there is maybe a way to do it currently by using the 'add all users' button in the group page … but that doesn't solve it for new users of course …

Maybe we need a way to configure the default capabilities for new users (not it's only two capabilities that are checked). That would probably solve that issue.

jonnyg
Confirmed Champ
Confirmed Champ
Joram - from the referenced thread, we simply want to automate how we can share a process/form/stencil with "all" – we are familiar with workflow systems where public sharing is the default. So it's been a scramble to try and support this. I think I heard that you were producing this for the next version.

So this is for organizational groups. Any other idea why updating the parent_group wouldn't work?

paulhh1
Champ in-the-making
Champ in-the-making
The feature that is coming may not be what you're looking for, but could be used that way.  The feature that's planned is a capability that anyone with it can see all process models etc.  It adds an extra filter in the model list view of "Everyone's".  The original requirement for this was that certain admin/special users needed to have visibility of all models for management and discovery purposes.

Currently, you would need an organization group that contains all users (or contains groups that together cover all users).

jonnyg
Confirmed Champ
Confirmed Champ
thanks – but back to the question at hand – why can't this work by updating the parent group directly to put everygroup under the "All" group?

jbarrez
Star Contributor
Star Contributor
I tried it here, and when I execute such a query, all groups come below the all group, at least in the UI.
Note that you do need to make sure the system groups are not touched (adding 'where group_type=1').

Also note that group info is cached and without a reboot could take a while to trickly down in the group pickers.

jonnyg
Confirmed Champ
Confirmed Champ
thanks. I'll try again with the new query. I did look for something related to cache, but not deeply enough.
How to refresh the whole cache?
If I update a group properly through the UI, will it clear the whole cache, or just for the that group?

jbarrez
Star Contributor
Star Contributor
Looking at the source code, it seems that updating the 'last update' column is sufficient to invalidate the cache on all nodes.