11-19-2008 10:30 AM
11-19-2008 12:11 PM
11-19-2008 12:46 PM
11-21-2008 05:00 AM
11-21-2008 08:29 AM
11-24-2008 03:21 AM
public class OwnerDynamicAuthority implements DynamicAuthority, InitializingBean
{
private OwnableService ownableService;
public OwnerDynamicAuthority()
{
super();
}
public void setOwnableService(OwnableService ownableService)
{
this.ownableService = ownableService;
}
public void afterPropertiesSet() throws Exception
{
if (ownableService == null)
{
throw new IllegalArgumentException("There must be an ownable service");
}
}
public boolean hasAuthority(final NodeRef nodeRef, final String userName)
{
return AuthenticationUtil.runAs(new RunAsWork<Boolean>(){
public Boolean doWork() throws Exception
{
// TODO Auto-generated method stub
return EqualsHelper.nullSafeEquals(ownableService.getOwner(nodeRef), userName);
}}, AuthenticationUtil.getSystemUserName());
}
public String getAuthority()
{
return PermissionService.OWNER_AUTHORITY;
}
}
11-25-2008 09:51 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.