use of org.alfresco.repo.virtual.template.FilingRule in project alfresco-repository by Alfresco.
the class GetAllSetPermissionsMethod method execute.
@Override
public Set<AccessPermission> execute(VirtualProtocol virtualProtocol, Reference reference) throws ProtocolMethodException {
Set<String> toAllow = userPermissions.getAllowSmartNodes();
Set<String> toDeny = userPermissions.getDenySmartNodes();
VirtualFolderDefinition definition = resolver.resolveVirtualFolderDefinition(reference);
FilingRule filingRule = definition.getFilingRule();
boolean readonly = filingRule.isNullFilingRule() || filingRule.filingNodeRefFor(new FilingParameters(reference)) == null;
if (readonly) {
Set<String> deniedPermissions = userPermissions.getDenyReadonlySmartNodes();
toDeny = new HashSet<>(toDeny);
toDeny.addAll(deniedPermissions);
toAllow.add(PermissionService.READ);
}
return execute(reference, toAllow, toDeny);
}
use of org.alfresco.repo.virtual.template.FilingRule in project alfresco-repository by Alfresco.
the class HasPermissionMethod method execute.
@Override
public AccessStatus execute(VirtualProtocol virtualProtocol, Reference reference) throws ProtocolMethodException {
VirtualFolderDefinition definition = resolver.resolveVirtualFolderDefinition(reference);
FilingRule filingRule = definition.getFilingRule();
boolean readonly = filingRule.isNullFilingRule() || filingRule.filingNodeRefFor(new FilingParameters(reference)) == null;
if (readonly) {
Set<String> deniedPermissions = userPermissions.getDenyReadonlySmartNodes();
if (deniedPermissions.contains(permissionToCheck)) {
return AccessStatus.DENIED;
}
if (PermissionService.READ.equals(permissionToCheck)) {
return AccessStatus.ALLOWED;
}
}
return userPermissions.hasVirtualNodePermission(permissionToCheck, readonly);
}
use of org.alfresco.repo.virtual.template.FilingRule in project alfresco-repository by Alfresco.
the class VirtualStoreImpl method createFilingData.
@Override
public FilingData createFilingData(Reference parentReference, QName assocTypeQName, QName assocQName, QName nodeTypeQName, Map<QName, Serializable> properties) throws VirtualizationException {
VirtualFolderDefinition structure = resolveVirtualFolderDefinition(parentReference);
FilingRule filingRule = structure.getFilingRule();
if (filingRule == null) {
filingRule = new NullFilingRule(environment);
}
FilingParameters filingParameters = new FilingParameters(parentReference, assocTypeQName, assocQName, nodeTypeQName, properties);
FilingData filingData = filingRule.createFilingData(filingParameters);
return filingData;
}
use of org.alfresco.repo.virtual.template.FilingRule in project alfresco-repository by Alfresco.
the class GetSetPermissionsMethod method execute.
@Override
public NodePermissionEntry execute(VirtualProtocol virtualProtocol, Reference reference) throws ProtocolMethodException {
Set<String> toAllow = userPermissions.getAllowSmartNodes();
Set<String> toDeny = userPermissions.getDenySmartNodes();
VirtualFolderDefinition definition = resolver.resolveVirtualFolderDefinition(reference);
FilingRule filingRule = definition.getFilingRule();
boolean readonly = filingRule.isNullFilingRule() || filingRule.filingNodeRefFor(new FilingParameters(reference)) == null;
if (readonly) {
Set<String> deniedPermissions = userPermissions.getDenyReadonlySmartNodes();
toDeny = new HashSet<>(toDeny);
toDeny.addAll(deniedPermissions);
toAllow.add(PermissionService.READ);
}
return execute(reference, toAllow, toDeny);
}
Aggregations