cancel
Showing results for 
Search instead for 
Did you mean: 

See some properties only for a group

rosh
Champ in-the-making
Champ in-the-making
Hi everyboby,
Can I see some properties only for a group?

Thanks,
Rosh

12 REPLIES 12

govinda
Champ in-the-making
Champ in-the-making
I have done this one of the easiest way.

1. Set the groups in preferences in server side js.
2. Get the group in client side js(form.js file) and using DOM hide it. 

rosh
Champ in-the-making
Champ in-the-making
Hi Govinda,
Could you give me a simple example?

Thanks

govinda
Champ in-the-making
Champ in-the-making
1> In preferance.get.js server side file, add the following code

var containerGroups = people.getContainerGroups(person),
            len = containerGroups.length,
            groups = [];
        if (len > 0) {
            for (var j = 0; j < len; j++) {
                var group = containerGroups[j].getQnamePath(),
                    p = group.split(":"),
                    gName = p[p.length - 1];
                logger.log("preferences group name = " + gName);
                groups.push(gName);
            }
        }
        preferences["groups"] = groups;


2> Check your group in form.js file and hide the required field

var pref = JSON.parse(Alfresco.constants.USERPREFERENCES);
if (pref.groups.indexOf("GROUP_ABC") != -1 ){
   Dom.get(this.parentId + "_prop_cm_name").parentNode.style.display = 'none';