Changes behavior in BaseRoleItemPane to throw an Exception when there are not the right privileges.
Also adds a new value to the CmsResources. git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4363 8810af33-2d31-482b-a856-94f89814c4dfpull/2/head
parent
72947f72d7
commit
1674b94ffd
|
|
@ -18,19 +18,14 @@
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.cms.ui.role;
|
package com.arsdigita.cms.ui.role;
|
||||||
|
|
||||||
import com.arsdigita.bebop.ActionLink;
|
import com.arsdigita.bebop.*;
|
||||||
import com.arsdigita.bebop.Component;
|
|
||||||
import com.arsdigita.bebop.Label;
|
|
||||||
import com.arsdigita.bebop.PageState;
|
|
||||||
import com.arsdigita.bebop.SimpleContainer;
|
|
||||||
import com.arsdigita.bebop.SingleSelectionModel;
|
|
||||||
import com.arsdigita.bebop.Table;
|
|
||||||
import com.arsdigita.bebop.event.TableActionAdapter;
|
import com.arsdigita.bebop.event.TableActionAdapter;
|
||||||
import com.arsdigita.bebop.event.TableActionEvent;
|
import com.arsdigita.bebop.event.TableActionEvent;
|
||||||
import com.arsdigita.bebop.table.DefaultTableCellRenderer;
|
import com.arsdigita.bebop.table.DefaultTableCellRenderer;
|
||||||
import com.arsdigita.cms.ui.BaseItemPane;
|
import com.arsdigita.cms.ui.BaseItemPane;
|
||||||
import com.arsdigita.cms.ui.PartySearchForm;
|
import com.arsdigita.cms.ui.PartySearchForm;
|
||||||
import com.arsdigita.cms.ui.VisibilityComponent;
|
import com.arsdigita.cms.ui.VisibilityComponent;
|
||||||
|
import com.arsdigita.globalization.GlobalizedMessage;
|
||||||
import com.arsdigita.kernel.KernelConfig;
|
import com.arsdigita.kernel.KernelConfig;
|
||||||
import com.arsdigita.toolbox.ui.ActionGroup;
|
import com.arsdigita.toolbox.ui.ActionGroup;
|
||||||
import com.arsdigita.toolbox.ui.PropertyList;
|
import com.arsdigita.toolbox.ui.PropertyList;
|
||||||
|
|
@ -180,12 +175,17 @@ class BaseRoleItemPane extends BaseItemPane {
|
||||||
|
|
||||||
private class Listener extends TableActionAdapter {
|
private class Listener extends TableActionAdapter {
|
||||||
@Override
|
@Override
|
||||||
public final void cellSelected(final TableActionEvent e) {
|
public final void cellSelected(final TableActionEvent e) throws FormProcessException {
|
||||||
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
||||||
final PageState state = e.getPageState();
|
final PageState state = e.getPageState();
|
||||||
final PermissionChecker permissionChecker = cdiUtil.findBean(PermissionChecker.class);
|
final PermissionChecker permissionChecker = cdiUtil.findBean(PermissionChecker.class);
|
||||||
|
|
||||||
if (e.getColumn() == 2 && permissionChecker.isPermitted(CmsConstants.PRIVILEGE_ADMINISTER_ROLES)) {
|
if (!permissionChecker.isPermitted(CmsConstants.PRIVILEGE_ADMINISTER_ROLES)) {
|
||||||
|
throw new FormProcessException(
|
||||||
|
new GlobalizedMessage("cms.ui.role.insufficient_privileges", CmsConstants.CMS_BUNDLE));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.getColumn() == 2) {
|
||||||
final Role role = m_role.getRole(state);
|
final Role role = m_role.getRole(state);
|
||||||
long itemId = Long.parseLong(e.getRowKey().toString());
|
long itemId = Long.parseLong(e.getRowKey().toString());
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,6 @@ import com.arsdigita.bebop.table.TableModel;
|
||||||
import com.arsdigita.ui.admin.GlobalizationUtil;
|
import com.arsdigita.ui.admin.GlobalizationUtil;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.libreccm.cdi.utils.CdiUtil;
|
import org.libreccm.cdi.utils.CdiUtil;
|
||||||
import org.libreccm.core.EmailAddress;
|
|
||||||
import org.libreccm.security.Party;
|
import org.libreccm.security.Party;
|
||||||
import org.libreccm.security.PartyRepository;
|
import org.libreccm.security.PartyRepository;
|
||||||
import org.libreccm.security.Role;
|
import org.libreccm.security.Role;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
contentsection.ui.admin.app_note=The properties for a Content Section are managed a special application:
|
contentsection.ui.admin.app_note=The properties for a Content Section are managed a special application:
|
||||||
contentsection.ui.admin.link_app=Go to Content Section application
|
contentsection.ui.admin.link_app=Go to Content Section application
|
||||||
|
cms.ui.role.insufficient_privileges=The user is not permitted to administrate roles.
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
contentsection.ui.admin.app_note=Die Verwaltung von Content Sections erfolgt \u00fcber eine eigene Application:
|
contentsection.ui.admin.app_note=Die Verwaltung von Content Sections erfolgt \u00fcber eine eigene Application:
|
||||||
contentsection.ui.admin.link_app=Zur Content Section Applikation
|
contentsection.ui.admin.link_app=Zur Content Section Applikation
|
||||||
|
cms.ui.role.insufficient_privileges=Der Benutzer ist nicht privilegiert Rollen zu administrieren.
|
||||||
|
|
@ -225,7 +225,7 @@ public class Table extends SimpleComponent {
|
||||||
* @param column the integer index of the selected column
|
* @param column the integer index of the selected column
|
||||||
*/
|
*/
|
||||||
protected void fireCellSelected(PageState state,
|
protected void fireCellSelected(PageState state,
|
||||||
Object rowKey, Integer column) {
|
Object rowKey, Integer column) throws FormProcessException {
|
||||||
Iterator i = m_listeners.getListenerIterator(TableActionListener.class);
|
Iterator i = m_listeners.getListenerIterator(TableActionListener.class);
|
||||||
TableActionEvent e = null;
|
TableActionEvent e = null;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,8 @@
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.bebop.event;
|
package com.arsdigita.bebop.event;
|
||||||
|
|
||||||
|
import com.arsdigita.bebop.FormProcessException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An implentation of the TableActionListener interface meant to save the
|
* An implentation of the TableActionListener interface meant to save the
|
||||||
* developer from having to override both the {@link
|
* developer from having to override both the {@link
|
||||||
|
|
@ -36,9 +38,7 @@ public class TableActionAdapter implements TableActionListener {
|
||||||
*
|
*
|
||||||
* @param e the event fired for the table.
|
* @param e the event fired for the table.
|
||||||
*/
|
*/
|
||||||
public void cellSelected(TableActionEvent e) {
|
public void cellSelected(TableActionEvent e) throws FormProcessException {}
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A no-op implementation of {@link
|
* A no-op implementation of {@link
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,8 @@
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.bebop.event;
|
package com.arsdigita.bebop.event;
|
||||||
|
|
||||||
|
import com.arsdigita.bebop.FormProcessException;
|
||||||
|
|
||||||
import java.util.EventListener;
|
import java.util.EventListener;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -39,7 +41,7 @@ public interface TableActionListener extends EventListener {
|
||||||
*
|
*
|
||||||
* @param e the event fired for the table.
|
* @param e the event fired for the table.
|
||||||
*/
|
*/
|
||||||
void cellSelected(TableActionEvent e);
|
void cellSelected(TableActionEvent e) throws FormProcessException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An event handler for actions on a particular column heading or
|
* An event handler for actions on a particular column heading or
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue