Alfresco 查找用户';他最喜欢户外活动
我正在使用Alfresco 4.2并试图查找一些用户的收藏夹,但我使用的webscript只返回当前用户的结果。我确信我正在调查的用户是存在的 我该怎么办?我做错了什么 下面是有效的webscript调用:Alfresco 查找用户';他最喜欢户外活动,alfresco,alfresco-webscripts,Alfresco,Alfresco Webscripts,我正在使用Alfresco 4.2并试图查找一些用户的收藏夹,但我使用的webscript只返回当前用户的结果。我确信我正在调查的用户是存在的 我该怎么办?我做错了什么 下面是有效的webscript调用: domain.com/alfresco/api/-default-/public/alfresco/versions/1/people/-me-/favorites 下面是一个不起作用的: domain.com/alfresco/api/-default-/public/alfresco/
domain.com/alfresco/api/-default-/public/alfresco/versions/1/people/-me-/favorites
下面是一个不起作用的:
domain.com/alfresco/api/-default-/public/alfresco/versions/1/people/user@tenant.com/favorites
并返回以下内容:
{"error":{"statusCode":404,"briefSummary":"04203980 The entity with id: user@tenant.com was not found","stackTrace":"[org.alfresco.rest.api.impl.PeopleImpl.validatePerson(PeopleImpl.java:155)
顺便说一句,
/favorites sites
而不是/favorites
对每个人都有效。404是一个误导。尝试对不存在的用户使用URL。这也将返回一个404,但错误会有点不同。访问一个退出的用户会给
The entity with id: existinguser was not found
The entity with id: personId is null. was not found
而不存在的用户给出
The entity with id: existinguser was not found
The entity with id: personId is null. was not found
如果尝试获取其他用户的收藏夹,HTTP响应状态应为403
您无法访问其他用户的收藏夹,因为类org.alfresco.rest.api.impl.PeopleImpl
检查调用用户是否与请求其收藏夹的用户相同。在Alfresco 5.0d中,相关代码为:
public String validatePerson(String personId, boolean validateIsCurrentUser)
{
if(personId.equalsIgnoreCase(DEFAULT_USER))
{
personId = AuthenticationUtil.getFullyAuthenticatedUser();
}
personId = personService.getUserIdentifier(personId);
if(personId == null)
{
// "User " + personId + " does not exist"
throw new EntityNotFoundException("personId is null.");
}
if(validateIsCurrentUser)
{
String currentUserId = AuthenticationUtil.getFullyAuthenticatedUser();
if(!currentUserId.equalsIgnoreCase(personId))
{
throw new EntityNotFoundException(personId);
}
}
return personId;
}
404是一种误导。尝试对不存在的用户使用URL。这也将返回一个404,但错误会有点不同。访问一个退出的用户会给
The entity with id: existinguser was not found
The entity with id: personId is null. was not found
而不存在的用户给出
The entity with id: existinguser was not found
The entity with id: personId is null. was not found
如果尝试获取其他用户的收藏夹,HTTP响应状态应为403
您无法访问其他用户的收藏夹,因为类org.alfresco.rest.api.impl.PeopleImpl
检查调用用户是否与请求其收藏夹的用户相同。在Alfresco 5.0d中,相关代码为:
public String validatePerson(String personId, boolean validateIsCurrentUser)
{
if(personId.equalsIgnoreCase(DEFAULT_USER))
{
personId = AuthenticationUtil.getFullyAuthenticatedUser();
}
personId = personService.getUserIdentifier(personId);
if(personId == null)
{
// "User " + personId + " does not exist"
throw new EntityNotFoundException("personId is null.");
}
if(validateIsCurrentUser)
{
String currentUserId = AuthenticationUtil.getFullyAuthenticatedUser();
if(!currentUserId.equalsIgnoreCase(personId))
{
throw new EntityNotFoundException(personId);
}
}
return personId;
}
我可以搜索其他用户最喜欢的网站,但不能查找其最喜欢的网站。我想知道这背后的原因。也许收藏夹是非常私人的:)。问问户外工程师:)我可以搜索其他用户最喜欢的网站,但我不能查找它的收藏夹。我想知道这背后的原因。也许最受欢迎的是非常私人的:)。问问户外工程师:)