001/*
002 * This library is part of OpenCms -
003 * the Open Source Content Management System
004 *
005 * Copyright (c) Alkacon Software GmbH & Co. KG (http://www.alkacon.com)
006 *
007 * This library is free software; you can redistribute it and/or
008 * modify it under the terms of the GNU Lesser General Public
009 * License as published by the Free Software Foundation; either
010 * version 2.1 of the License, or (at your option) any later version.
011 *
012 * This library is distributed in the hope that it will be useful,
013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015 * Lesser General Public License for more details.
016 *
017 * For further information about Alkacon Software, please see the
018 * company website: http://www.alkacon.com
019 *
020 * For further information about OpenCms, please see the
021 * project website: http://www.opencms.org
022 *
023 * You should have received a copy of the GNU Lesser General Public
024 * License along with this library; if not, write to the Free Software
025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
026 */
027
028package org.opencms.ui.dialogs.permissions;
029
030import org.opencms.file.CmsObject;
031import org.opencms.file.CmsResource;
032import org.opencms.file.CmsResourceFilter;
033import org.opencms.file.CmsUser;
034import org.opencms.lock.CmsLockActionRecord;
035import org.opencms.lock.CmsLockActionRecord.LockChange;
036import org.opencms.lock.CmsLockException;
037import org.opencms.lock.CmsLockUtil;
038import org.opencms.main.CmsException;
039import org.opencms.main.CmsLog;
040import org.opencms.security.CmsAccessControlEntry;
041import org.opencms.security.CmsPermissionSet;
042import org.opencms.security.CmsPrincipal;
043import org.opencms.security.CmsRole;
044import org.opencms.security.I_CmsPrincipal;
045import org.opencms.ui.CmsVaadinUtils;
046import org.opencms.ui.FontOpenCms;
047import org.opencms.ui.I_CmsDialogContext;
048import org.opencms.ui.components.CmsBasicDialog;
049import org.opencms.ui.components.CmsOkCancelActionHandler;
050import org.opencms.ui.contextmenu.CmsStandardVisibilityCheck;
051import org.opencms.ui.dialogs.permissions.CmsPermissionView.PermissionChangeHandler;
052import org.opencms.ui.dialogs.permissions.CmsPrincipalSelect.I_PrincipalSelectHandler;
053import org.opencms.util.CmsStringUtil;
054import org.opencms.util.CmsUUID;
055import org.opencms.workplace.CmsWorkplace;
056import org.opencms.workplace.commons.Messages;
057import org.opencms.workplace.explorer.CmsResourceUtil;
058
059import java.util.ArrayList;
060import java.util.Collections;
061import java.util.HashMap;
062import java.util.HashSet;
063import java.util.Iterator;
064import java.util.List;
065import java.util.Map;
066import java.util.Set;
067
068import org.apache.commons.logging.Log;
069
070import com.vaadin.ui.Accordion;
071import com.vaadin.ui.Button;
072import com.vaadin.ui.Button.ClickEvent;
073import com.vaadin.ui.Button.ClickListener;
074import com.vaadin.ui.TabSheet.SelectedTabChangeEvent;
075import com.vaadin.ui.TabSheet.SelectedTabChangeListener;
076import com.vaadin.ui.themes.ValoTheme;
077import com.vaadin.v7.event.FieldEvents.TextChangeEvent;
078import com.vaadin.v7.event.FieldEvents.TextChangeListener;
079import com.vaadin.v7.ui.HorizontalLayout;
080import com.vaadin.v7.ui.Label;
081import com.vaadin.v7.ui.TextField;
082import com.vaadin.v7.ui.VerticalLayout;
083
084/**
085 * The permission dialog.<p>
086 */
087public class CmsPermissionDialog extends CmsBasicDialog implements PermissionChangeHandler, I_PrincipalSelectHandler {
088
089    /** The possible types of new access control entries. */
090    protected static final String[] PRINCIPAL_TYPES = {
091        I_CmsPrincipal.PRINCIPAL_GROUP,
092        I_CmsPrincipal.PRINCIPAL_USER,
093        CmsRole.PRINCIPAL_ROLE,
094        CmsAccessControlEntry.PRINCIPAL_ALL_OTHERS_NAME,
095        CmsAccessControlEntry.PRINCIPAL_OVERWRITE_ALL_NAME};
096
097    /** The possible type values of access control entries. */
098    protected static final int[] PRINCIPAL_TYPES_INT = {
099        CmsAccessControlEntry.ACCESS_FLAGS_GROUP,
100        CmsAccessControlEntry.ACCESS_FLAGS_USER,
101        CmsAccessControlEntry.ACCESS_FLAGS_ROLE,
102        CmsAccessControlEntry.ACCESS_FLAGS_ALLOTHERS,
103        CmsAccessControlEntry.ACCESS_FLAGS_OVERWRITE_ALL};
104
105    /** The logger instance for this class. */
106    private static final Log LOG = CmsLog.getLog(CmsPermissionDialog.class);
107
108    /** The serial version id. */
109    private static final long serialVersionUID = 2397141190651779325L;
110
111    /**Set of permissions to save on ok-Button click. */
112    private Set<CmsPermissionBean> m_permissionToChange = new HashSet<CmsPermissionBean>();
113
114    /** The permission view accordion. */
115    private Accordion m_accordion;
116
117    /** The close button. */
118    private Button m_closeButton;
119
120    /** The ok button.*/
121    private Button m_okButton;
122
123    /** The cms context. */
124    private CmsObject m_cms;
125
126    /** The dialog context. */
127    private I_CmsDialogContext m_context;
128
129    /** The editable flag. */
130    private boolean m_editable = true;
131
132    /** The inherited permissions panel. */
133    private VerticalLayout m_inheritedPermissions;
134
135    /** The lock action record. */
136    private CmsLockActionRecord m_lockActionRecord;
137
138    /** main layout. */
139    private VerticalLayout m_main;
140
141    /** The principal select widget. */
142    private CmsPrincipalSelect m_principalSelect;
143
144    /** The resource. */
145    private CmsResource m_resource;
146
147    /**Parent path map. */
148    private Map<CmsUUID, String> m_parents;
149
150    /** The resource permissions panel. */
151    private VerticalLayout m_resourcePermissions;
152
153    /** The tab for setting permissions. */
154    private VerticalLayout m_setPermissionTab;
155
156    /** The user permission panel. */
157    private VerticalLayout m_userPermissions;
158
159    /**
160     * Constructor.<p>
161     *
162     * @param context the dialog context.<p>
163     */
164    public CmsPermissionDialog(I_CmsDialogContext context) {
165
166        m_context = context;
167        m_cms = context.getCms();
168        m_editable = CmsStandardVisibilityCheck.PERMISSIONS.getVisibility(context).isActive();
169        m_resource = context.getResources().get(0);
170        boolean editRoles = CmsWorkplace.canEditPermissionsForRoles(m_cms, m_resource.getRootPath());
171        CmsVaadinUtils.readAndLocalizeDesign(this, CmsVaadinUtils.getWpMessagesForCurrentLocale(), null);
172        m_main.setHeightUndefined();
173        if (m_editable) {
174            m_principalSelect.setMargin(true);
175            m_principalSelect.setSelectHandler(this);
176            m_principalSelect.setRoleSelectionAllowed(editRoles);
177        } else {
178            m_principalSelect.setVisible(false);
179        }
180        displayResourceInfo(Collections.singletonList(m_resource));
181        displayUserPermissions(m_cms.getRequestContext().getCurrentUser());
182        displayInheritedPermissions();
183        displayResourcePermissions();
184        m_closeButton.addClickListener(new ClickListener() {
185
186            private static final long serialVersionUID = 1L;
187
188            public void buttonClick(ClickEvent event) {
189
190                close();
191            }
192
193        });
194        m_accordion.addSelectedTabChangeListener(new SelectedTabChangeListener() {
195
196            private static final long serialVersionUID = 1L;
197
198            public void selectedTabChange(SelectedTabChangeEvent event) {
199
200                onViewChange();
201            }
202        });
203
204        m_okButton.addClickListener(new ClickListener() {
205
206            private static final long serialVersionUID = -8061995491261573917L;
207
208            public void buttonClick(ClickEvent event) {
209
210                savePermissions();
211                close();
212            }
213
214        });
215
216        setActionHandler(new CmsOkCancelActionHandler() {
217
218            private static final long serialVersionUID = 1L;
219
220            @Override
221            protected void cancel() {
222
223                close();
224            }
225
226            @Override
227            protected void ok() {
228
229                // nothing to do
230            }
231        });
232        m_accordion.setSelectedTab(m_setPermissionTab);
233        m_principalSelect.setPrincipalType(I_CmsPrincipal.PRINCIPAL_GROUP);
234
235    }
236
237    /**
238     * @see org.opencms.ui.dialogs.permissions.CmsPermissionView.PermissionChangeHandler#deletePermissionSet(java.lang.String, java.lang.String)
239     */
240    public void deletePermissionSet(String principalType, String principalName) {
241
242        CmsPermissionBean bean = new CmsPermissionBean(principalType, principalName);
243        m_permissionToChange.remove(bean);
244        m_permissionToChange.add(bean);
245        refreshOwnEntries();
246    }
247
248    /**
249     * @see org.opencms.ui.dialogs.permissions.CmsPrincipalSelect.I_PrincipalSelectHandler#onPrincipalSelect(java.lang.String, java.lang.String)
250     */
251    public void onPrincipalSelect(String principalType, String principalName) {
252
253        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(principalName)) {
254            String permissionString = "";
255            if (m_resource.isFolder()) {
256                permissionString = "+i";
257            }
258
259            try {
260                // lock resource if autolock is enabled
261                ensureLock();
262                CmsPermissionBean bean = null;
263                if (principalName.equals(CmsVaadinUtils.getMessageText(Messages.GUI_LABEL_ALLOTHERS_0))) {
264                    bean = new CmsPermissionBean(
265                        "Unknown",
266                        CmsAccessControlEntry.PRINCIPAL_ALL_OTHERS_NAME,
267                        permissionString);
268                    bean.setFlags(CmsAccessControlEntry.ACCESS_FLAGS_ALLOTHERS);
269
270                } else if (principalName.equals(CmsVaadinUtils.getMessageText(Messages.GUI_LABEL_OVERWRITEALL_0))) {
271                    bean = new CmsPermissionBean(
272                        "Unknown",
273                        CmsAccessControlEntry.PRINCIPAL_OVERWRITE_ALL_NAME,
274                        permissionString);
275                    bean.setFlags(CmsAccessControlEntry.ACCESS_FLAGS_OVERWRITE_ALL);
276
277                } else {
278                    if (principalType.equalsIgnoreCase(CmsRole.PRINCIPAL_ROLE)) {
279                        // if role, first check if we have to translate the role name
280                        CmsRole role = CmsRole.valueOfRoleName(principalName);
281                        if (role == null) {
282                            // we need translation
283                            Iterator<CmsRole> it = CmsRole.getSystemRoles().iterator();
284                            while (it.hasNext()) {
285                                role = it.next();
286                                if (role.getName(getLocale()).equalsIgnoreCase(principalName)) {
287                                    principalName = role.getRoleName();
288                                    break;
289                                }
290                            }
291                        }
292                    }
293                    bean = new CmsPermissionBean(principalType, principalName, permissionString);
294                }
295                m_permissionToChange.remove(bean);
296                m_permissionToChange.add(bean);
297                refreshOwnEntries();
298                onViewChange();
299
300            } catch (CmsException e) {
301                m_context.error(e);
302            }
303        }
304    }
305
306    /**
307     * @see org.opencms.ui.dialogs.permissions.CmsPermissionView.PermissionChangeHandler#onViewChange()
308     */
309    public void onViewChange() {
310
311        CmsVaadinUtils.centerWindow(m_main);
312    }
313
314    /**
315     * @see org.opencms.ui.dialogs.permissions.CmsPermissionView.PermissionChangeHandler#setPermissions(org.opencms.ui.dialogs.permissions.CmsPermissionBean)
316     */
317    public void setPermissions(CmsPermissionBean bean) {
318
319        m_permissionToChange.remove(bean);
320        m_permissionToChange.add(bean);
321
322    }
323
324    /**
325     * Creates an HTML input form for the current access control entry.<p>
326     *
327     * @param entry the current access control entry
328     * @param editable boolean to determine if the form is editable
329     * @param extendedView boolean to determine if the view is selectable with DHTML
330     * @param inheritRes the resource name from which the ace is inherited
331     * @return StringBuffer with HTML code of the form
332     */
333    protected CmsPermissionView buildPermissionEntryForm(
334        CmsAccessControlEntry entry,
335        boolean editable,
336        boolean extendedView,
337        CmsUUID inheritRes) {
338
339        return new CmsPermissionView(
340            entry,
341            editable,
342            m_resource.isFolder(),
343            inheritRes == null ? null : m_parents.get(inheritRes),
344            this);
345    }
346
347    /**
348     * Returns the resource on which the specified access control entry was set.<p>
349     *
350     * @param entry the current access control entry
351     * @param parents the parent resources to determine the connected resource
352     * @return the resource name of the corresponding resource
353     */
354    protected String getConnectedResource(CmsAccessControlEntry entry, Map<CmsUUID, String> parents) {
355
356        CmsUUID resId = entry.getResource();
357        String resName = parents.get(resId);
358        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(resName)) {
359            return resName;
360        }
361        return resId.toString();
362    }
363
364    /**
365     * Closes the dialog.<p>
366     */
367    void close() {
368
369        try {
370            clearLock();
371            m_context.finish(Collections.singletonList(m_resource.getStructureId()));
372        } catch (CmsException e) {
373            m_context.error(e);
374        }
375    }
376
377    /**
378     * Displays the inherited permissions.<p>
379     */
380    void displayInheritedPermissions() {
381
382        // store all parent folder ids together with path in a map
383        m_parents = new HashMap<CmsUUID, String>();
384        String sitePath = m_cms.getSitePath(m_resource);
385        String path = CmsResource.getParentFolder(sitePath);
386        List<CmsResource> parentResources = new ArrayList<CmsResource>();
387        try {
388            // get all parent folders of the current file
389            parentResources = m_cms.readPath(path, CmsResourceFilter.IGNORE_EXPIRATION);
390        } catch (CmsException e) {
391            // can usually be ignored
392            if (LOG.isInfoEnabled()) {
393                LOG.info(e.getLocalizedMessage());
394            }
395        }
396        Iterator<CmsResource> k = parentResources.iterator();
397        while (k.hasNext()) {
398            // add the current folder to the map
399            CmsResource curRes = k.next();
400            m_parents.put(curRes.getResourceId(), curRes.getRootPath());
401        }
402
403        ArrayList<CmsAccessControlEntry> inheritedEntries = new ArrayList<CmsAccessControlEntry>();
404        try {
405            Iterator<CmsAccessControlEntry> itAces = m_cms.getAccessControlEntries(path, true).iterator();
406            while (itAces.hasNext()) {
407                CmsAccessControlEntry curEntry = itAces.next();
408                inheritedEntries.add(curEntry);
409            }
410        } catch (CmsException e) {
411            // can usually be ignored
412            if (LOG.isInfoEnabled()) {
413                LOG.info(e.getLocalizedMessage());
414            }
415        }
416        addEntryTableToLayout(inheritedEntries, m_inheritedPermissions, false, true);
417
418        //        buildInheritedList(inheritedEntries, parents);
419    }
420
421    /**
422     * Displays the resource permissions.<p>
423     */
424    void displayResourcePermissions() {
425
426        refreshOwnEntries();
427    }
428
429    /**
430     * Displays the user permissions.<p>
431     *
432     * @param user the selected user
433     */
434    void displayUserPermissions(CmsUser user) {
435
436        CmsPermissionView view = buildPermissionEntryForm(user.getId(), buildPermissionsForCurrentUser(), false, false);
437        view.hideDeniedColumn();
438        m_userPermissions.addComponent(view);
439    }
440
441    /**
442     * Saves the permission.<p>
443     */
444    void savePermissions() {
445
446        try {
447            ensureLock();
448            for (CmsPermissionBean bean : m_permissionToChange) {
449                if (bean.isDeleted()) {
450                    m_cms.rmacc(m_cms.getSitePath(m_resource), bean.getPrincipalType(), bean.getPrincipalName());
451
452                } else {
453                    if (bean.getPermissionString() == null) {
454                        m_cms.chacc(
455                            m_cms.getSitePath(m_resource),
456                            bean.getPrincipalType(),
457                            bean.getPrincipalName(),
458                            bean.getAllowed(),
459                            bean.getDenied(),
460                            bean.getFlags());
461                    } else {
462                        m_cms.chacc(
463                            m_cms.getSitePath(m_resource),
464                            bean.getPrincipalType(),
465                            bean.getPrincipalName(),
466                            bean.getPermissionString());
467                    }
468                }
469            }
470        } catch (CmsException e) {
471            m_context.error(e);
472        }
473    }
474
475    /**
476     * Adds list of entries to layout.<p>
477     *
478     * @param entries the ace list
479     * @param layout layout
480     * @param editable boolean
481     * @param inheritedRes boolean
482     */
483    private void addEntryTableToLayout(
484        List<CmsAccessControlEntry> entries,
485        VerticalLayout layout,
486        boolean editable,
487        boolean inheritedRes) {
488
489        final CmsPermissionViewTable table = new CmsPermissionViewTable(
490            m_cms,
491            entries,
492            editable,
493            inheritedRes,
494            m_parents,
495            this);
496        HorizontalLayout hl = new HorizontalLayout();
497        Label label = new Label(
498            CmsVaadinUtils.getMessageText(
499                Messages.GUI_PERMISSION_COUNT_1,
500                Integer.valueOf(table.getContainerDataSource().size())));
501        label.addStyleName("o-report");
502        hl.addComponent(label);
503        TextField tableFilter = new TextField();
504        tableFilter.setIcon(FontOpenCms.FILTER);
505        tableFilter.setInputPrompt(CmsVaadinUtils.getMessageText(org.opencms.ui.apps.Messages.GUI_EXPLORER_FILTER_0));
506        tableFilter.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
507        tableFilter.setWidth("200px");
508        tableFilter.addTextChangeListener(new TextChangeListener() {
509
510            private static final long serialVersionUID = 1L;
511
512            public void textChange(TextChangeEvent event) {
513
514                table.filterTable(event.getText());
515            }
516        });
517        hl.addComponent(tableFilter);
518        hl.setWidth("100%");
519        hl.setExpandRatio(label, 1);
520        hl.setMargin(true);
521        hl.setComponentAlignment(tableFilter, com.vaadin.ui.Alignment.MIDDLE_RIGHT);
522        if (table.getContainerDataSource().size() == 0) {
523            layout.addComponent(CmsVaadinUtils.getInfoLayout(Messages.GUI_PERMISSION_EMPTY_0));
524        } else {
525            layout.addComponent(hl);
526            layout.addComponent(table);
527            CmsVaadinUtils.centerWindow(this);
528        }
529    }
530
531    /**
532     * @see #buildPermissionEntryForm(CmsAccessControlEntry, boolean, boolean, CmsUUID)
533     *
534     * @param id the UUID of the principal of the permission set
535     * @param curSet the current permission set
536     * @param editable boolean to determine if the form is editable
537     * @param extendedView boolean to determine if the view is selectable with DHTML
538     * @return String with HTML code of the form
539     */
540    private CmsPermissionView buildPermissionEntryForm(
541        CmsUUID id,
542        CmsPermissionSet curSet,
543        boolean editable,
544        boolean extendedView) {
545
546        String fileName = m_cms.getSitePath(m_resource);
547        int flags = 0;
548        try {
549            I_CmsPrincipal p;
550            try {
551                p = CmsPrincipal.readPrincipalIncludingHistory(m_cms, id);
552            } catch (CmsException e) {
553                p = null;
554            }
555            if ((p != null) && p.isGroup()) {
556                flags = CmsAccessControlEntry.ACCESS_FLAGS_GROUP;
557            } else if ((p != null) && p.isUser()) {
558                flags = CmsAccessControlEntry.ACCESS_FLAGS_USER;
559            } else if ((p == null) && id.equals(CmsAccessControlEntry.PRINCIPAL_ALL_OTHERS_ID)) {
560                flags = CmsAccessControlEntry.ACCESS_FLAGS_ALLOTHERS;
561            } else if ((p == null) && id.equals(CmsAccessControlEntry.PRINCIPAL_OVERWRITE_ALL_ID)) {
562                flags = CmsAccessControlEntry.ACCESS_FLAGS_OVERWRITE_ALL;
563            } else {
564                // check if it is the case of a role
565                CmsRole role = CmsRole.valueOfId(id);
566                if (role != null) {
567                    flags = CmsAccessControlEntry.ACCESS_FLAGS_ROLE;
568                }
569            }
570
571            CmsResource res = m_cms.readResource(fileName, CmsResourceFilter.ALL);
572            CmsAccessControlEntry entry = new CmsAccessControlEntry(res.getResourceId(), id, curSet, flags);
573            return buildPermissionEntryForm(entry, editable, extendedView, null);
574        } catch (CmsException e) {
575            // can usually be ignored
576            if (LOG.isInfoEnabled()) {
577                LOG.info(e.getLocalizedMessage());
578            }
579            return null;
580        }
581    }
582
583    /**
584     * Returns the actual real permissions (including role, and any other special check) for the current user.<p>
585     *
586     * @return the actual real permissions for the current user
587     */
588    private CmsPermissionSet buildPermissionsForCurrentUser() {
589
590        CmsResourceUtil resUtil = new CmsResourceUtil(m_cms, m_resource);
591        return resUtil.getPermissionSet();
592    }
593
594    /**
595     * Clears the resource lock.<p>
596     *
597     * @throws CmsException in case reading the resource fails
598     */
599    private void clearLock() throws CmsException {
600
601        if ((m_lockActionRecord != null) && (m_lockActionRecord.getChange() == LockChange.locked)) {
602            CmsResource updatedRes = m_cms.readResource(m_resource.getStructureId(), CmsResourceFilter.ALL);
603            try {
604                m_cms.unlockResource(updatedRes);
605            } catch (CmsLockException e) {
606                LOG.warn(e.getLocalizedMessage(), e);
607            }
608            m_lockActionRecord = null;
609        }
610    }
611
612    /**
613     * Locks the current resource.<p>
614     *
615     * @throws CmsException in case locking the resource fails
616     */
617    private void ensureLock() throws CmsException {
618
619        if (m_lockActionRecord == null) {
620            m_lockActionRecord = CmsLockUtil.ensureLock(m_cms, m_resource, true);
621        }
622    }
623
624    /**
625     * Refreshes the display of the resource permission display.<p>
626     */
627    @SuppressWarnings("unchecked")
628    private void refreshOwnEntries() {
629
630        m_resourcePermissions.removeAllComponents();
631        String sitePath = m_cms.getSitePath(m_resource);
632
633        // create new ArrayLists in which inherited and non inherited entries are stored
634        ArrayList<CmsAccessControlEntry> ownEntries = new ArrayList<CmsAccessControlEntry>();
635        try {
636            Iterator<CmsAccessControlEntry> itAces = m_cms.getAccessControlEntries(sitePath, false).iterator();
637            HashSet<CmsPermissionBean> newBeans = (HashSet<CmsPermissionBean>)((HashSet<CmsPermissionBean>)(m_permissionToChange)).clone();
638            while (itAces.hasNext()) {
639                CmsAccessControlEntry curEntry = itAces.next();
640                if (!curEntry.isInherited()) {
641                    // add the entry to the own rights list
642                    CmsPermissionBean bean = CmsPermissionBean.getBeanForPrincipal(
643                        m_permissionToChange,
644                        CmsPermissionBean.getPrincipalNameFromACE(m_cms, curEntry));
645                    if (bean == null) {
646                        ownEntries.add(curEntry);
647                    } else {
648                        if (!bean.isDeleted()) {
649                            CmsAccessControlEntry entry = bean.toAccessControlEntry(m_cms, m_resource.getStructureId());
650                            if (entry != null) {
651                                ownEntries.add(entry);
652                            }
653                        }
654                        //No new entry -> remove from new list
655                        newBeans.remove(bean);
656                    }
657                }
658            }
659            for (CmsPermissionBean newBean : newBeans) {
660                if (!newBean.isDeleted()) {
661                    CmsAccessControlEntry entry = newBean.toAccessControlEntry(m_cms, m_resource.getStructureId());
662                    if (entry != null) {
663                        ownEntries.add(entry);
664                    }
665                }
666            }
667        } catch (CmsException e) {
668            // can usually be ignored
669        }
670
671        addEntryTableToLayout(ownEntries, m_resourcePermissions, true, false);
672    }
673}