mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
User Account enabled/disabled status now shown on User Details screen in new Administration Console.
Repository JavaScript API now supports getting/setting user account enabled status (admin authority required). Repository Template API now supports retrieving user account enabled status. Fixed up line endings on template-services-context.xml. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13884 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -30,6 +30,7 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.security.authentication.MutableAuthenticationDao;
|
||||
import org.alfresco.repo.security.authority.AuthorityDAO;
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
@@ -50,6 +51,7 @@ public class People extends BaseTemplateProcessorExtension
|
||||
private ServiceRegistry services;
|
||||
private AuthorityDAO authorityDAO;
|
||||
private AuthorityService authorityService;
|
||||
private MutableAuthenticationDao mutableAuthenticationDao;
|
||||
private PersonService personService;
|
||||
private StoreRef storeRef;
|
||||
|
||||
@@ -109,6 +111,16 @@ public class People extends BaseTemplateProcessorExtension
|
||||
this.personService = personService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the mutable authentication dao
|
||||
*
|
||||
* @param mutableAuthenticationDao Mutable Authentication DAO
|
||||
*/
|
||||
public void setMutableAuthenticationDao(MutableAuthenticationDao mutableAuthenticationDao)
|
||||
{
|
||||
this.mutableAuthenticationDao = mutableAuthenticationDao;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Person given the username
|
||||
*
|
||||
@@ -212,6 +224,18 @@ public class People extends BaseTemplateProcessorExtension
|
||||
ParameterCheck.mandatory("Person", person);
|
||||
return this.authorityService.isAdminAuthority((String)person.getProperties().get(ContentModel.PROP_USERNAME));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if the specified user account is enabled.
|
||||
*
|
||||
* @param person to test
|
||||
*
|
||||
* @return true if account enabled, false if disabled
|
||||
*/
|
||||
public boolean isAccountEnabled(TemplateNode person)
|
||||
{
|
||||
return this.mutableAuthenticationDao.getEnabled((String)person.getProperties().get(ContentModel.PROP_USERNAME));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Contained Authorities
|
||||
|
Reference in New Issue
Block a user