mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM Transfer Bug Fixes:
* RM-336: Impossible to create File Report for transferred object * RM-170: Not successfully complete Transfer action * RM-210: Assession disposition action does not disappear after event completion * RM-224: Script error when add Disposition Transfer Step if user doesn't have access to any Transfer Location * RM-346: Incorrect list of actions for transfered Folder or Record * RM-358: A folder isn't displayed in Transfers without without reloading the page. * RM-331: Audit is removed from Transfers and Holds * Also the transfer and accession capabilities are refactored to work correctly. * Transfer, accend, and relevant complete actions all correctly react to the different capability assignments. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.0@36528 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -64,13 +64,21 @@ public interface CapabilityService
|
||||
Set<Capability> getCapabilities(boolean includePrivate);
|
||||
|
||||
/**
|
||||
* Get all the capabilities access state based on the current user.
|
||||
* Get all the capabilities access state based on the current user for the assignable capabilities.
|
||||
*
|
||||
* @param nodeRef node reference
|
||||
* @return
|
||||
*/
|
||||
Map<Capability, AccessStatus> getCapabilitiesAccessState(NodeRef nodeRef);
|
||||
|
||||
/**
|
||||
* Get all the capabilities access state based on the current user.
|
||||
*
|
||||
* @param nodeRef node reference
|
||||
* @return
|
||||
*/
|
||||
Map<Capability, AccessStatus> getCapabilitiesAccessState(NodeRef nodeRef, boolean includePrivate);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param nodeRef
|
||||
|
@@ -94,8 +94,18 @@ public class CapabilityServiceImpl implements CapabilityService
|
||||
*/
|
||||
public Map<Capability, AccessStatus> getCapabilitiesAccessState(NodeRef nodeRef)
|
||||
{
|
||||
return getCapabilitiesAccessState(nodeRef, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#getCapabilitiesAccessState(org.alfresco.service.cmr.repository.NodeRef, boolean)
|
||||
*/
|
||||
@Override
|
||||
public Map<Capability, AccessStatus> getCapabilitiesAccessState(NodeRef nodeRef, boolean includePrivate)
|
||||
{
|
||||
Set<Capability> listOfCapabilites = getCapabilities(includePrivate);
|
||||
HashMap<Capability, AccessStatus> answer = new HashMap<Capability, AccessStatus>();
|
||||
for (Capability capability : capabilities.values())
|
||||
for (Capability capability : listOfCapabilites)
|
||||
{
|
||||
AccessStatus status = capability.hasPermission(nodeRef);
|
||||
if (answer.put(capability, status) != null)
|
||||
|
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2011 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.alfresco.module.org_alfresco_module_rm.capability.declarative.condition;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.capability.declarative.AbstractCapabilityCondition;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
|
||||
/**
|
||||
* @author Roy Wetherall
|
||||
*/
|
||||
public class HasAspectCapabilityCondition extends AbstractCapabilityCondition
|
||||
{
|
||||
private String aspectName;
|
||||
|
||||
private NamespaceService namespaceService;
|
||||
|
||||
public void setAspectName(String aspectName)
|
||||
{
|
||||
this.aspectName = aspectName;
|
||||
}
|
||||
|
||||
public void setNamespaceService(NamespaceService namespaceService)
|
||||
{
|
||||
this.namespaceService = namespaceService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.declarative.CapabilityCondition#evaluate(org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
@Override
|
||||
public boolean evaluate(NodeRef nodeRef)
|
||||
{
|
||||
boolean result = false;
|
||||
if (aspectName != null)
|
||||
{
|
||||
QName aspect = QName.createQName(aspectName, namespaceService);
|
||||
result = nodeService.hasAspect(nodeRef, aspect);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
@@ -24,7 +24,7 @@ import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionService
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
|
||||
/**
|
||||
* Indicates whether the given disposition action 'may' be scheduled in the future
|
||||
* Indicates whether the given disposition action is scheduled next
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
*/
|
||||
|
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2011 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.alfresco.module.org_alfresco_module_rm.capability.declarative.condition;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.FilePlanComponentKind;
|
||||
import org.alfresco.module.org_alfresco_module_rm.capability.declarative.AbstractCapabilityCondition;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
|
||||
/**
|
||||
* @author Roy Wetherall
|
||||
*/
|
||||
public class IsTransferAccessionCapabilityCondition extends AbstractCapabilityCondition
|
||||
{
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.capability.declarative.CapabilityCondition#evaluate(org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
@Override
|
||||
public boolean evaluate(NodeRef nodeRef)
|
||||
{
|
||||
boolean result = false;
|
||||
|
||||
FilePlanComponentKind kind = rmService.getFilePlanComponentKind(nodeRef);
|
||||
if (FilePlanComponentKind.TRANSFER.equals(kind) == true)
|
||||
{
|
||||
Boolean value = (Boolean)nodeService.getProperty(nodeRef, PROP_TRANSFER_ACCESSION_INDICATOR);
|
||||
if (value != null)
|
||||
{
|
||||
result = value.booleanValue();
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user