Search in sources :

Example 1 with CustomModelService

use of org.alfresco.service.cmr.dictionary.CustomModelService in project alfresco-remote-api by Alfresco.

the class BaseCustomModelApiTest method setup.

@Before
public void setup() throws Exception {
    authenticationService = applicationContext.getBean("authenticationService", MutableAuthenticationService.class);
    personService = applicationContext.getBean("personService", PersonService.class);
    customModelService = applicationContext.getBean("customModelService", CustomModelService.class);
    final AuthorityService authorityService = applicationContext.getBean("authorityService", AuthorityService.class);
    this.nonAdminUserName = createUser("nonAdminUser" + System.currentTimeMillis(), "password", null);
    this.customModelAdmin = createUser("customModelAdmin" + System.currentTimeMillis(), "password", null);
    users.add(nonAdminUserName);
    users.add(customModelAdmin);
    // Add 'customModelAdmin' user into 'ALFRESCO_MODEL_ADMINISTRATORS' group
    transactionHelper.doInTransaction(new RetryingTransactionCallback<Void>() {

        @Override
        public Void execute() throws Throwable {
            authorityService.addAuthority(CustomModelServiceImpl.GROUP_ALFRESCO_MODEL_ADMINISTRATORS_AUTHORITY, customModelAdmin);
            return null;
        }
    });
}
Also used : CustomModelService(org.alfresco.service.cmr.dictionary.CustomModelService) PersonService(org.alfresco.service.cmr.security.PersonService) AuthorityService(org.alfresco.service.cmr.security.AuthorityService) MutableAuthenticationService(org.alfresco.service.cmr.security.MutableAuthenticationService) Before(org.junit.Before)

Aggregations

CustomModelService (org.alfresco.service.cmr.dictionary.CustomModelService)1 AuthorityService (org.alfresco.service.cmr.security.AuthorityService)1 MutableAuthenticationService (org.alfresco.service.cmr.security.MutableAuthenticationService)1 PersonService (org.alfresco.service.cmr.security.PersonService)1 Before (org.junit.Before)1