View Javadoc
1   /*
2    * Copyright (C) 2003-2008 eXo Platform SAS.
3    *
4    * This program is free software; you can redistribute it and/or
5    * modify it under the terms of the GNU Affero General Public License
6    * as published by the Free Software Foundation; either version 3
7    * of the License, or (at your option) any later version.
8    *
9    * This program is distributed in the hope that it will be useful,
10   * but WITHOUT ANY WARRANTY; without even the implied warranty of
11   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12   * GNU General Public License for more details.
13   *
14   * You should have received a copy of the GNU General Public License
15   * along with this program; if not, see<http://www.gnu.org/licenses/>.
16   */
17  package org.exoplatform.wcm.webui.dialog.permission;
18  
19  import java.security.AccessControlException;
20  import java.util.ArrayList;
21  import java.util.HashMap;
22  import java.util.Iterator;
23  import java.util.List;
24  import java.util.Map;
25  
26  import javax.jcr.AccessDeniedException;
27  import javax.jcr.Node;
28  import javax.jcr.Session;
29  
30  import org.exoplatform.commons.utils.LazyPageList;
31  import org.exoplatform.commons.utils.ListAccess;
32  import org.exoplatform.commons.utils.ListAccessImpl;
33  import org.exoplatform.ecm.webui.form.UIFormInputSetWithAction;
34  import org.exoplatform.ecm.webui.selector.UIGroupMemberSelector;
35  import org.exoplatform.ecm.webui.selector.UISelectable;
36  import org.exoplatform.services.jcr.access.AccessControlEntry;
37  import org.exoplatform.services.jcr.access.PermissionType;
38  import org.exoplatform.services.jcr.core.ExtendedNode;
39  import org.exoplatform.services.security.IdentityConstants;
40  import org.exoplatform.services.wcm.core.NodeLocation;
41  import org.exoplatform.wcm.webui.Utils;
42  import org.exoplatform.wcm.webui.dialog.UIContentDialogForm;
43  import org.exoplatform.wcm.webui.selector.account.UIUserContainer;
44  import org.exoplatform.web.application.ApplicationMessage;
45  import org.exoplatform.webui.config.annotation.ComponentConfig;
46  import org.exoplatform.webui.config.annotation.EventConfig;
47  import org.exoplatform.webui.core.UIGrid;
48  import org.exoplatform.webui.core.UIPopupContainer;
49  import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
50  import org.exoplatform.webui.event.Event;
51  import org.exoplatform.webui.event.EventListener;
52  import org.exoplatform.webui.form.UIForm;
53  import org.exoplatform.webui.form.UIFormStringInput;
54  import org.exoplatform.webui.form.input.UICheckBoxInput;
55  
56  /**
57   * Created by The eXo Platform SAS
58   * Author : Phan Le Thanh Chuong
59   *          chuong.phan@exoplatform.com, phan.le.thanh.chuong@gmail.com
60   * Oct 29, 2009
61   */
62  @ComponentConfig (
63      lifecycle = UIFormLifecycle.class,
64      template = "classpath:groovy/wcm/webui/dialog/permission/UIPermissionManager.gtmpl",
65      events = {
66        @EventConfig(listeners = UIPermissionManager.DeleteActionListener.class,
67                     confirm = "UIPermissionManagerGrid.msg.confirm-delete-permission"),
68        @EventConfig(listeners = UIPermissionManager.EditActionListener.class),
69        @EventConfig(listeners = UIPermissionManager.SaveActionListener.class),
70        @EventConfig(listeners = UIPermissionManager.ClearActionListener.class),
71        @EventConfig(listeners = UIPermissionManager.SelectUserActionListener.class),
72        @EventConfig(listeners = UIPermissionManager.SelectMemberActionListener.class),
73        @EventConfig(listeners = UIPermissionManager.AddAnyActionListener.class)
74      }
75  )
76  public class UIPermissionManager extends UIForm implements UISelectable {
77  
78    /** The Constant PERMISSION_MANAGER_GRID. */
79    public static final String PERMISSION_MANAGER_GRID     = "UIPermissionManagerGrid";
80  
81    /** The Constant PERMISSION_INPUT_SET. */
82    public static final String PERMISSION_INPUT_SET        = "UIPermissionInputSetWithAction";
83  
84    /** The Constant PERMISSION_STRING_INPUT. */
85    public static final String PERMISSION_STRING_INPUT     = "UIPermissionStringInput";
86  
87    /** The Constant ACCESSIBLE_CHECKBOX_INPUT. */
88    public static final String ACCESSIBLE_CHECKBOX_INPUT   = "UIAccessibleCheckboxInput";
89  
90    /** The Constant EDITABLE_CHECKBOX_INPUT. */
91    public static final String EDITABLE_CHECKBOX_INPUT     = "UIEditableCheckboxInput";
92  
93    public static final String USER_SELECTOR_POPUP_WINDOW  = "UIUserSelectorPopupWindow";
94  
95    public static final String GROUP_SELECTOR_POPUP_WINDOW = "UIGroupSelectorPopupWindow";
96  
97    private String popupId;
98  
99    public String getPopupId() {
100     return popupId;
101   }
102 
103   public void setPopupId(String popupId) {
104     this.popupId = popupId;
105   }
106 
107   /**
108    * Instantiates a new uI permission info.
109    *
110    * @throws Exception the exception
111    */
112   public UIPermissionManager() throws Exception {
113     UIGrid uiGrid = createUIComponent(UIGrid.class, null, PERMISSION_MANAGER_GRID);
114     uiGrid.setLabel(PERMISSION_MANAGER_GRID);
115     uiGrid.configure("owner", new String[] {"owner", "accessible", "editable"}, new String[] {"Edit", "Delete"});
116     addChild(uiGrid);
117 
118     UIFormInputSetWithAction permissionInputSet = new UIFormInputSetWithAction(PERMISSION_INPUT_SET);
119     UIFormStringInput formStringInput = new UIFormStringInput(PERMISSION_STRING_INPUT, PERMISSION_STRING_INPUT, null);
120     formStringInput.setReadOnly(true);
121     permissionInputSet.addChild(formStringInput);
122     permissionInputSet.setActionInfo(PERMISSION_STRING_INPUT, new String[] {"SelectUser", "SelectMember", "AddAny"});
123     permissionInputSet.showActionInfo(true);
124     addChild(permissionInputSet);
125     addChild(new UICheckBoxInput(ACCESSIBLE_CHECKBOX_INPUT, ACCESSIBLE_CHECKBOX_INPUT, null));
126     addChild(new UICheckBoxInput(EDITABLE_CHECKBOX_INPUT, EDITABLE_CHECKBOX_INPUT, null));
127     setActions(new String[] {"Save", "Clear"});
128   }
129 
130   /**
131    * Update grid.
132    *
133    * @throws Exception the exception
134    */
135   public void updateGrid() throws Exception {
136     // Get node
137     UIContentDialogForm contentDialogForm = getAncestorOfType(UIPopupContainer.class).getChild(UIContentDialogForm.class);
138     NodeLocation webcontentNodeLocation = contentDialogForm.getWebcontentNodeLocation();
139     Node node = NodeLocation.getNodeByLocation(webcontentNodeLocation);
140     ExtendedNode webcontent = (ExtendedNode) node;
141 
142     // Convert permission entries to map
143     List<UIPermissionConfig> permissionConfigs = new ArrayList<UIPermissionConfig>();
144     Map<String, List<String>> permissionMap = new HashMap<String, List<String>>();
145     List<AccessControlEntry> accessControlEntries = webcontent.getACL().getPermissionEntries();
146     for (AccessControlEntry accessControlEntry : accessControlEntries) {
147       String identity = accessControlEntry.getIdentity();
148       String permission = accessControlEntry.getPermission();
149       List<String> currentPermissions = permissionMap.get(identity);
150       if (!permissionMap.containsKey(identity)) {
151         permissionMap.put(identity, null);
152       }
153       if (currentPermissions == null)
154         currentPermissions = new ArrayList<String>();
155       if (!currentPermissions.contains(permission)) {
156         currentPermissions.add(permission);
157       }
158       permissionMap.put(identity, currentPermissions);
159     }
160 
161     // Add owner's permission
162     String owner = IdentityConstants.SYSTEM;
163     if (webcontent.hasProperty("exo:owner"))
164       owner = webcontent.getProperty("exo:owner").getString();
165     UIPermissionConfig permissionConfig = new UIPermissionConfig();
166     if (!permissionMap.containsKey(owner)) {
167       permissionConfig.setOwner(owner);
168       permissionConfig.setAccessible(true);
169       permissionConfig.setEditable(true);
170       permissionConfigs.add(permissionConfig);
171     }
172 
173     // Add node's permission
174     Iterator<String> permissionIterator = permissionMap.keySet().iterator();
175     while (permissionIterator.hasNext()) {
176       String identity = (String) permissionIterator.next();
177       List<String> userPermissions = permissionMap.get(identity);
178       UIPermissionConfig permBean = new UIPermissionConfig();
179       permBean.setOwner(identity);
180       int numberPermission = 0;
181       for (String p : PermissionType.ALL) {
182         if (!userPermissions.contains(p)) break;
183         numberPermission++;
184       }
185       if (numberPermission == PermissionType.ALL.length) {
186         permBean.setEditable(true);
187         permBean.setAccessible(true);
188       } else {
189         permBean.setAccessible(true);
190       }
191       permissionConfigs.add(permBean);
192     }
193     ListAccess<UIPermissionConfig> permConfigList = new ListAccessImpl<UIPermissionConfig>(UIPermissionConfig.class,
194                                                                                            permissionConfigs);
195     LazyPageList<UIPermissionConfig> dataPageList = new LazyPageList<UIPermissionConfig>(permConfigList,
196                                                                                          10);
197     UIGrid uiGrid = getChildById(PERMISSION_MANAGER_GRID);
198     uiGrid.getUIPageIterator().setPageList(dataPageList);
199   }
200 
201   /* (non-Javadoc)
202    * @see org.exoplatform.ecm.webui.selector.UISelectable#doSelect(java.lang.String, java.lang.Object)
203    */
204   public void doSelect(String selectField, Object value) throws Exception {
205     UIFormInputSetWithAction permissionInputSet = getChildById(PERMISSION_INPUT_SET);
206     permissionInputSet.getUIStringInput(PERMISSION_STRING_INPUT).setValue(value.toString());
207     Utils.closePopupWindow(this, popupId);
208   }
209 
210   /**
211   * Checks for change permission right.
212   *
213   * @param node the node
214   *
215   * @return true, if successful
216   *
217   * @throws Exception the exception
218   */
219   private boolean hasChangePermissionRight(ExtendedNode node) throws Exception {
220    try {
221      node.checkPermission(PermissionType.ADD_NODE);
222      node.checkPermission(PermissionType.REMOVE);
223      node.checkPermission(PermissionType.SET_PROPERTY);
224      return true;
225    } catch (AccessControlException e) {
226      return false;
227    }
228   }
229 
230   /**
231    * The listener interface for receiving deleteAction events.
232    * The class that is interested in processing a deleteAction
233    * event implements this interface, and the object created
234    * with that class is registered with a component using the
235    * component's <code>addDeleteActionListener</code> method. When
236    * the deleteAction event occurs, that object's appropriate
237    * method is invoked.
238    */
239   public static class DeleteActionListener extends EventListener<UIPermissionManager> {
240 
241     /* (non-Javadoc)
242      * @see org.exoplatform.webui.event.EventListener#execute(org.exoplatform.webui.event.Event)
243      */
244     public void execute(Event<UIPermissionManager> event) throws Exception {
245       UIPermissionManager permissionManager = event.getSource();
246       UIContentDialogForm contentDialogForm = permissionManager.getAncestorOfType(UIPopupContainer.class)
247                                                                .getChild(UIContentDialogForm.class);
248       NodeLocation webcontentNodeLocation = contentDialogForm.getWebcontentNodeLocation();
249       Node node = NodeLocation.getNodeByLocation(webcontentNodeLocation);
250       ExtendedNode webcontent = (ExtendedNode) node;
251       Session session = webcontent.getSession();
252 
253       String name = event.getRequestContext().getRequestParameter(OBJECTID);
254       String nodeOwner = webcontent.getProperty("exo:owner").getString();
255       if (name.equals(nodeOwner)) {
256         Utils.createPopupMessage(permissionManager,
257                                  "UIPermissionManagerGrid.msg.no-permission-remove",
258                                  null,
259                                  ApplicationMessage.WARNING);
260         return;
261       }
262       if (permissionManager.hasChangePermissionRight(webcontent)) {
263         if (webcontent.canAddMixin("exo:privilegeable")) {
264           webcontent.addMixin("exo:privilegeable");
265           webcontent.setPermission(nodeOwner, PermissionType.ALL);
266         }
267         try {
268           webcontent.removePermission(name);
269           session.save();
270           permissionManager.updateGrid();
271         } catch (AccessControlException e) {
272           Object[] args = {webcontent.getPath()};
273           Utils.createPopupMessage(permissionManager,
274                                    "UIPermissionManagerGrid.msg.node-locked",
275                                    args,
276                                    ApplicationMessage.WARNING);
277           return;
278         } catch (AccessDeniedException ace) {
279           Utils.createPopupMessage(permissionManager,
280                                    "UIPermissionManagerGrid.msg.access-denied",
281                                    null,
282                                    ApplicationMessage.WARNING);
283           return;
284         }
285       }
286     }
287   }
288 
289   /**
290    * The listener interface for receiving editAction events.
291    * The class that is interested in processing a editAction
292    * event implements this interface, and the object created
293    * with that class is registered with a component using the
294    * component's <code>addEditActionListener</code> method. When
295    * the editAction event occurs, that object's appropriate
296    * method is invoked.
297    */
298   public static class EditActionListener extends EventListener<UIPermissionManager> {
299 
300     /* (non-Javadoc)
301      * @see org.exoplatform.webui.event.EventListener#execute(org.exoplatform.webui.event.Event)
302      */
303     public void execute(Event<UIPermissionManager> event) throws Exception {
304       UIPermissionManager permissionManager = event.getSource();
305       UIContentDialogForm contentDialogForm = permissionManager.getAncestorOfType(UIPopupContainer.class)
306                                                                .getChild(UIContentDialogForm.class);
307       NodeLocation webcontentNodeLocation = contentDialogForm.getWebcontentNodeLocation();
308       Node node = NodeLocation.getNodeByLocation(webcontentNodeLocation);
309       ExtendedNode webcontent = (ExtendedNode) node;
310       String name = event.getRequestContext().getRequestParameter(OBJECTID);
311 
312       UIFormInputSetWithAction permissionInputSet = permissionManager.getChildById(PERMISSION_INPUT_SET);
313       permissionInputSet.getUIStringInput(PERMISSION_STRING_INPUT).setValue(name);
314       String owner = node.getProperty("exo:owner").getString();
315       if (name.equals(owner)) {
316         permissionManager.getUICheckBoxInput(ACCESSIBLE_CHECKBOX_INPUT).setChecked(true);
317         permissionManager.getUICheckBoxInput(EDITABLE_CHECKBOX_INPUT).setChecked(true);
318         permissionManager.setActions(new String[] {"Clear"});
319         permissionInputSet.setActionInfo(PERMISSION_STRING_INPUT, null);
320       } else {
321         List<AccessControlEntry> permsList = webcontent.getACL().getPermissionEntries();
322         StringBuilder userPermission = new StringBuilder();
323         for (AccessControlEntry accessControlEntry : permsList) {
324           if (name.equals(accessControlEntry.getIdentity())) {
325             userPermission.append(accessControlEntry.getPermission()).append(" ");
326           }
327         }
328         int numPermission = 0;
329         for (String perm : PermissionType.ALL) {
330           if (userPermission.toString().contains(perm))
331             numPermission++;
332         }
333         if (numPermission == PermissionType.ALL.length) {
334           permissionManager.getUICheckBoxInput(ACCESSIBLE_CHECKBOX_INPUT).setChecked(true);
335           permissionManager.getUICheckBoxInput(EDITABLE_CHECKBOX_INPUT).setChecked(true);
336         } else {
337           permissionManager.getUICheckBoxInput(ACCESSIBLE_CHECKBOX_INPUT).setChecked(true);
338           permissionManager.getUICheckBoxInput(EDITABLE_CHECKBOX_INPUT).setChecked(false);
339         }
340         permissionManager.setActions(new String[] {"Save", "Clear"});
341         permissionInputSet.setActionInfo(PERMISSION_STRING_INPUT, new String[] { "SelectUser",
342             "SelectMember", "AddAny" });
343       }
344     }
345   }
346 
347   /**
348   * The listener interface for receiving saveAction events.
349   * The class that is interested in processing a saveAction
350   * event implements this interface, and the object created
351   * with that class is registered with a component using the
352   * component's <code>addSaveActionListener</code> method. When
353   * the saveAction event occurs, that object's appropriate
354   * method is invoked.
355   */
356   public static class SaveActionListener extends EventListener<UIPermissionManager> {
357 
358    /* (non-Javadoc)
359     * @see org.exoplatform.webui.event.EventListener#execute(org.exoplatform.webui.event.Event)
360     */
361    public void execute(Event<UIPermissionManager> event) throws Exception {
362      UIPermissionManager permissionManager = event.getSource();
363       UIContentDialogForm contentDialogForm = permissionManager.getAncestorOfType(UIPopupContainer.class)
364                                                                .getChild(UIContentDialogForm.class);
365      NodeLocation webcontentNodeLocation = contentDialogForm.getWebcontentNodeLocation();
366      Node node = NodeLocation.getNodeByLocation(webcontentNodeLocation);
367      ExtendedNode webcontent = (ExtendedNode) node;
368      Session session = webcontent.getSession();
369 
370      UIFormInputSetWithAction formInputSet = permissionManager.getChildById(PERMISSION_INPUT_SET);
371      String identity = ((UIFormStringInput) formInputSet.getChildById(PERMISSION_STRING_INPUT)).getValue();
372      List<String> permsList = new ArrayList<String>();
373      if (!webcontent.isCheckedOut()) {
374         Utils.createPopupMessage(permissionManager,
375                                  "UIPermissionManagerGrid.msg.node-checkedin",
376                                  null,
377                                  ApplicationMessage.WARNING);
378        return;
379      }
380      if (permissionManager.getUICheckBoxInput(ACCESSIBLE_CHECKBOX_INPUT).isChecked()) {
381        permsList.clear();
382        permsList.add(PermissionType.READ);
383      }
384      if (permissionManager.getUICheckBoxInput(EDITABLE_CHECKBOX_INPUT).isChecked()) {
385        permsList.clear();
386        for (String perm : PermissionType.ALL)
387          permsList.add(perm);
388      }
389      if (identity == null || identity.trim().length() == 0) {
390         Utils.createPopupMessage(permissionManager,
391                                  "UIPermissionManagerGrid.msg.userOrGroup-required",
392                                  null,
393                                  ApplicationMessage.WARNING);
394        return;
395      }
396      if (permsList.size() == 0) {
397         Utils.createPopupMessage(permissionManager,
398                                  "UIPermissionManagerGrid.msg.checkbox-require",
399                                  null,
400                                  ApplicationMessage.WARNING);
401        return;
402      }
403      String[] permsArray = permsList.toArray(new String[permsList.size()]);
404      if (webcontent.canAddMixin("exo:privilegeable")) {
405        webcontent.addMixin("exo:privilegeable");
406        webcontent.setPermission(webcontent.getProperty("exo:owner").getString(), PermissionType.ALL);
407      }
408      try {
409       webcontent.setPermission(identity, permsArray);
410     } catch (AccessControlException e) {
411       Object[] args = {webcontent.getPath()};
412         Utils.createPopupMessage(permissionManager,
413                                  "UIPermissionManagerGrid.msg.node-locked",
414                                  args,
415                                  ApplicationMessage.WARNING);
416       return;
417     }
418      session.save();
419 
420      permissionManager.updateGrid();
421      UIFormInputSetWithAction permissionInputSet = permissionManager.getChildById(PERMISSION_INPUT_SET);
422      ((UIFormStringInput) permissionInputSet.getChildById(PERMISSION_STRING_INPUT)).setValue("");
423      permissionManager.getUICheckBoxInput(ACCESSIBLE_CHECKBOX_INPUT).setChecked(false);
424      permissionManager.getUICheckBoxInput(EDITABLE_CHECKBOX_INPUT).setChecked(false);
425    }
426   }
427 
428 
429   /**
430   * The listener interface for receiving resetAction events.
431   * The class that is interested in processing a resetAction
432   * event implements this interface, and the object created
433   * with that class is registered with a component using the
434   * component's <code>addResetActionListener</code> method. When
435   * the resetAction event occurs, that object's appropriate
436   * method is invoked.
437   */
438   public static class ClearActionListener extends EventListener<UIPermissionManager> {
439 
440    /* (non-Javadoc)
441     * @see org.exoplatform.webui.event.EventListener#execute(org.exoplatform.webui.event.Event)
442     */
443    public void execute(Event<UIPermissionManager> event) throws Exception {
444      UIPermissionManager permissionManager = event.getSource();
445      UIFormInputSetWithAction permissionInputSet = permissionManager.getChildById(PERMISSION_INPUT_SET);
446      ((UIFormStringInput) permissionInputSet.getChildById(PERMISSION_STRING_INPUT)).setValue("");
447      permissionManager.getUICheckBoxInput(ACCESSIBLE_CHECKBOX_INPUT).setChecked(false);
448      permissionManager.getUICheckBoxInput(EDITABLE_CHECKBOX_INPUT).setChecked(false);
449      permissionManager.setActions(new String[] {"Save", "Clear"});
450       permissionInputSet.setActionInfo(PERMISSION_STRING_INPUT, new String[] { "SelectUser",
451           "SelectMember", "AddAny" });
452    }
453   }
454 
455   /**
456   * The listener interface for receiving selectUserAction events.
457   * The class that is interested in processing a selectUserAction
458   * event implements this interface, and the object created
459   * with that class is registered with a component using the
460   * component's <code>addSelectUserActionListener</code> method. When
461   * the selectUserAction event occurs, that object's appropriate
462   * method is invoked.
463   */
464   public static class SelectUserActionListener extends EventListener<UIPermissionManager> {
465 
466    /* (non-Javadoc)
467     * @see org.exoplatform.webui.event.EventListener#execute(org.exoplatform.webui.event.Event)
468     */
469    public void execute(Event<UIPermissionManager> event) throws Exception {
470      UIPermissionManager permissionManager = event.getSource();
471      UIUserContainer userContainer = permissionManager.createUIComponent(UIUserContainer.class, null, null);
472      userContainer.setSelectable(permissionManager);
473      userContainer.setSourceComponent(PERMISSION_STRING_INPUT);
474      Utils.createPopupWindow(permissionManager, userContainer, USER_SELECTOR_POPUP_WINDOW, 740);
475      permissionManager.setPopupId(USER_SELECTOR_POPUP_WINDOW);
476    }
477   }
478 
479   /**
480   * The listener interface for receiving selectMemberAction events.
481   * The class that is interested in processing a selectMemberAction
482   * event implements this interface, and the object created
483   * with that class is registered with a component using the
484   * component's <code>addSelectMemberActionListener</code> method. When
485   * the selectMemberAction event occurs, that object's appropriate
486   * method is invoked.
487   */
488   public static class SelectMemberActionListener extends EventListener<UIPermissionManager> {
489 
490     /* (non-Javadoc)
491      * @see org.exoplatform.webui.event.EventListener#execute(org.exoplatform.webui.event.Event)
492      */
493     public void execute(Event<UIPermissionManager> event) throws Exception {
494       UIPermissionManager permissionManager = event.getSource();
495       UIGroupMemberSelector groupContainer = permissionManager.createUIComponent(UIGroupMemberSelector.class, null, null);
496       groupContainer.setShowAnyPermission(false);
497       groupContainer.setSourceComponent(permissionManager, new String[] {PERMISSION_STRING_INPUT});
498       Utils.createPopupWindow(permissionManager, groupContainer, GROUP_SELECTOR_POPUP_WINDOW, 600);
499       permissionManager.setPopupId(GROUP_SELECTOR_POPUP_WINDOW);
500     }
501   }
502 
503   /**
504    * The listener interface for receiving addAnyAction events.
505    * The class that is interested in processing a addAnyAction
506    * event implements this interface, and the object created
507    * with that class is registered with a component using the
508    * component's <code>addAddAnyActionListener</code> method. When
509    * the addAnyAction event occurs, that object's appropriate
510    * method is invoked.
511    */
512   public static class AddAnyActionListener extends EventListener<UIPermissionManager> {
513 
514     /* (non-Javadoc)
515      * @see org.exoplatform.webui.event.EventListener#execute(org.exoplatform.webui.event.Event)
516      */
517     public void execute(Event<UIPermissionManager> event) throws Exception {
518       UIPermissionManager permissionManager = event.getSource();
519       UIFormInputSetWithAction permisionInputSet = permissionManager.getChildById(PERMISSION_INPUT_SET);
520       ((UIFormStringInput) permisionInputSet.getChildById(PERMISSION_STRING_INPUT)).setValue(IdentityConstants.ANY);
521       permissionManager.getUICheckBoxInput(ACCESSIBLE_CHECKBOX_INPUT).setChecked(true);
522       permissionManager.getUICheckBoxInput(EDITABLE_CHECKBOX_INPUT).setChecked(false);
523     }
524   }
525 
526 }