mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
ALF-9321 (RINF 11): CQ permissions
- minor: push down common method lookup code git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@28640 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -18,12 +18,10 @@
|
||||
*/
|
||||
package org.alfresco.repo.blog;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.query.AbstractCannedQueryFactory;
|
||||
import org.alfresco.query.CannedQuery;
|
||||
@@ -88,27 +86,12 @@ public class DraftsAndPublishedBlogPostsCannedQueryFactory extends AbstractCanne
|
||||
@Override
|
||||
public CannedQuery<BlogPostInfo> getCannedQuery(CannedQueryParameters parameters)
|
||||
{
|
||||
Method method = null;
|
||||
for (Method m : methodService.getClass().getMethods())
|
||||
{
|
||||
// note: currently matches first found
|
||||
if (m.getName().equals(methodName))
|
||||
{
|
||||
method = m;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (method == null)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Method not found: "+methodName);
|
||||
}
|
||||
|
||||
// if not passed in (TODO or not in future cache) then generate a new query execution id
|
||||
String queryExecutionId = (parameters.getQueryExecutionId() == null ? super.getQueryExecutionId(parameters) : parameters.getQueryExecutionId());
|
||||
|
||||
final DraftsAndPublishedBlogPostsCannedQuery cq = new DraftsAndPublishedBlogPostsCannedQuery(rawNodeService, taggingService,
|
||||
methodSecurityInterceptor, method, parameters, queryExecutionId);
|
||||
methodSecurityInterceptor, methodService, methodName,
|
||||
parameters, queryExecutionId);
|
||||
return (CannedQuery<BlogPostInfo>) cq;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user