CCM NG/ccm-cms: More work for Content Item edit.
git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4820 8810af33-2d31-482b-a856-94f89814c4df
parent
cc7094653a
commit
b385cd58e4
|
|
@ -37,7 +37,6 @@ import org.libreccm.security.User;
|
||||||
import org.libreccm.workflow.AssignableTask;
|
import org.libreccm.workflow.AssignableTask;
|
||||||
import org.libreccm.workflow.AssignableTaskManager;
|
import org.libreccm.workflow.AssignableTaskManager;
|
||||||
import org.libreccm.workflow.AssignableTaskRepository;
|
import org.libreccm.workflow.AssignableTaskRepository;
|
||||||
import org.libreccm.workflow.WorkflowManager;
|
|
||||||
import org.librecms.CmsConstants;
|
import org.librecms.CmsConstants;
|
||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,6 @@ import com.arsdigita.bebop.PageState;
|
||||||
import org.librecms.contentsection.ContentItem;
|
import org.librecms.contentsection.ContentItem;
|
||||||
|
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.dispatcher.Utilities;
|
|
||||||
import com.arsdigita.toolbox.ui.ComponentAccess;
|
import com.arsdigita.toolbox.ui.ComponentAccess;
|
||||||
|
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
|
@ -63,6 +62,7 @@ public class WorkflowLockedComponentAccess extends ComponentAccess {
|
||||||
*
|
*
|
||||||
* @param component The component
|
* @param component The component
|
||||||
* @param check An access check
|
* @param check An access check
|
||||||
|
* @param itemModel
|
||||||
*/
|
*/
|
||||||
public WorkflowLockedComponentAccess(final Component component,
|
public WorkflowLockedComponentAccess(final Component component,
|
||||||
final String check,
|
final String check,
|
||||||
|
|
|
||||||
|
|
@ -329,3 +329,4 @@ cms.ui.workflow.task.unlock=Unlock task
|
||||||
cms.ui.workflow.task.user.add=Assign user
|
cms.ui.workflow.task.user.add=Assign user
|
||||||
cms.ui.workflow.task.locked_by=Locked by {0}
|
cms.ui.workflow.task.locked_by=Locked by {0}
|
||||||
cms.ui.workflow.task.locked_by_you=Locked by you
|
cms.ui.workflow.task.locked_by_you=Locked by you
|
||||||
|
cms.ui.edit=Edit
|
||||||
|
|
|
||||||
|
|
@ -326,3 +326,4 @@ cms.ui.workflow.task.unlock=Aufgabe freigeben
|
||||||
cms.ui.workflow.task.user.add=Benutzer zuordnen
|
cms.ui.workflow.task.user.add=Benutzer zuordnen
|
||||||
cms.ui.workflow.task.locked_by=Reserviert durch {0}
|
cms.ui.workflow.task.locked_by=Reserviert durch {0}
|
||||||
cms.ui.workflow.task.locked_by_you=Von Ihnen reserviert
|
cms.ui.workflow.task.locked_by_you=Von Ihnen reserviert
|
||||||
|
cms.ui.edit=Bearbeiten
|
||||||
|
|
|
||||||
|
|
@ -285,3 +285,4 @@ cms.ui.workflow.task.unlock=Unlock task
|
||||||
cms.ui.workflow.task.user.add=Assign user
|
cms.ui.workflow.task.user.add=Assign user
|
||||||
cms.ui.workflow.task.locked_by=Locked by {0}
|
cms.ui.workflow.task.locked_by=Locked by {0}
|
||||||
cms.ui.workflow.task.locked_by_you=Locked by you
|
cms.ui.workflow.task.locked_by_you=Locked by you
|
||||||
|
cms.ui.edit=Edit
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,8 @@ import org.libreccm.cdi.utils.CdiUtil;
|
||||||
|
|
||||||
import org.libreccm.security.PermissionChecker;
|
import org.libreccm.security.PermissionChecker;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* Wrapper class that registers access checks (actions) to a Bebop
|
* Wrapper class that registers access checks (actions) to a Bebop
|
||||||
|
|
@ -46,7 +48,7 @@ public class ComponentAccess {
|
||||||
* @param component The component
|
* @param component The component
|
||||||
*/
|
*/
|
||||||
public ComponentAccess(final Component component) {
|
public ComponentAccess(final Component component) {
|
||||||
accessCheckList = new ArrayList();
|
accessCheckList = new ArrayList<>();
|
||||||
this.component = component;
|
this.component = component;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -74,7 +76,7 @@ public class ComponentAccess {
|
||||||
* @return The list of access checks
|
* @return The list of access checks
|
||||||
*/
|
*/
|
||||||
public List<String> getAccessCheckList() {
|
public List<String> getAccessCheckList() {
|
||||||
return accessCheckList;
|
return Collections.unmodifiableList(accessCheckList);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -96,6 +98,10 @@ public class ComponentAccess {
|
||||||
final PermissionChecker permissionChecker = cdiUtil.findBean(
|
final PermissionChecker permissionChecker = cdiUtil.findBean(
|
||||||
PermissionChecker.class);
|
PermissionChecker.class);
|
||||||
|
|
||||||
|
if (accessCheckList.isEmpty()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
final Optional<Boolean> canAccess = accessCheckList.stream()
|
final Optional<Boolean> canAccess = accessCheckList.stream()
|
||||||
.map(accessCheck -> permissionChecker.isPermitted(accessCheck))
|
.map(accessCheck -> permissionChecker.isPermitted(accessCheck))
|
||||||
.reduce((result1, result2) -> result1 && result2);
|
.reduce((result1, result2) -> result1 && result2);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue