Search in sources :

Example 1 with ConfigAttribute

use of net.sf.acegisecurity.ConfigAttribute in project records-management by Alfresco.

the class RMEntryVoterUnitTest method createConfigDefinition.

/**
 * Helper method to create configuration object
 */
@SuppressWarnings("rawtypes")
private net.sf.acegisecurity.ConfigAttributeDefinition createConfigDefinition(String value) {
    net.sf.acegisecurity.ConfigAttributeDefinition mockedConfig = mock(net.sf.acegisecurity.ConfigAttributeDefinition.class);
    ConfigAttribute mockedConfigAttr = mock(ConfigAttribute.class);
    when(mockedConfigAttr.getAttribute()).thenReturn(value);
    Iterator mockedIter = mock(Iterator.class);
    when(mockedIter.hasNext()).thenReturn(true).thenReturn(false);
    when(mockedIter.next()).thenReturn(mockedConfigAttr);
    when(mockedConfig.getConfigAttributes()).thenReturn(mockedIter);
    return mockedConfig;
}
Also used : ConfigAttribute(net.sf.acegisecurity.ConfigAttribute) Iterator(java.util.Iterator)

Example 2 with ConfigAttribute

use of net.sf.acegisecurity.ConfigAttribute in project records-management by Alfresco.

the class RMAfterInvocationProvider method extractSupportedDefinitions.

@SuppressWarnings("rawtypes")
private List<ConfigAttributeDefintion> extractSupportedDefinitions(ConfigAttributeDefinition config) {
    List<ConfigAttributeDefintion> definitions = new ArrayList<>();
    Iterator iter = config.getConfigAttributes();
    while (iter.hasNext()) {
        ConfigAttribute attr = (ConfigAttribute) iter.next();
        if (this.supports(attr)) {
            definitions.add(new ConfigAttributeDefintion(attr));
        }
    }
    return definitions;
}
Also used : ConfigAttribute(net.sf.acegisecurity.ConfigAttribute) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator)

Example 3 with ConfigAttribute

use of net.sf.acegisecurity.ConfigAttribute in project records-management by Alfresco.

the class RMEntryVoter method extractSupportedDefinitions.

/**
 * @param config
 * @return
 */
@SuppressWarnings("rawtypes")
private List<ConfigAttributeDefinition> extractSupportedDefinitions(net.sf.acegisecurity.ConfigAttributeDefinition config) {
    List<ConfigAttributeDefinition> definitions = new ArrayList<ConfigAttributeDefinition>(2);
    Iterator iter = config.getConfigAttributes();
    while (iter.hasNext()) {
        ConfigAttribute attr = (ConfigAttribute) iter.next();
        if (this.supports(attr)) {
            definitions.add(new ConfigAttributeDefinition(attr, nspr));
        }
    }
    return definitions;
}
Also used : ConfigAttribute(net.sf.acegisecurity.ConfigAttribute) ConfigAttributeDefinition(org.alfresco.module.org_alfresco_module_rm.capability.policy.ConfigAttributeDefinition) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator)

Aggregations

Iterator (java.util.Iterator)3 ConfigAttribute (net.sf.acegisecurity.ConfigAttribute)3 ArrayList (java.util.ArrayList)2 ConfigAttributeDefinition (org.alfresco.module.org_alfresco_module_rm.capability.policy.ConfigAttributeDefinition)1