use of org.apache.archiva.rest.api.model.RBACManagerImplementationInformation in project archiva by apache.
the class RedbackRuntimeConfigurationServiceTest method rbacmanagersinformations.
@Test
public void rbacmanagersinformations() throws Exception {
RedbackRuntimeConfigurationService service = getRedbackRuntimeConfigurationService();
List<RBACManagerImplementationInformation> infos = service.getRbacManagerImplementationInformations();
assertThat(infos).isNotNull().isNotEmpty().contains(new RBACManagerImplementationInformation("jpa", null, false));
}
use of org.apache.archiva.rest.api.model.RBACManagerImplementationInformation in project archiva by apache.
the class DefaultRedbackRuntimeConfigurationService method getRbacManagerImplementationInformations.
@Override
public List<RBACManagerImplementationInformation> getRbacManagerImplementationInformations() throws ArchivaRestServiceException {
Map<String, RBACManager> beans = applicationContext.getBeansOfType(RBACManager.class);
if (beans.isEmpty()) {
return Collections.emptyList();
}
List<RBACManagerImplementationInformation> informations = new ArrayList<>(beans.size());
for (Map.Entry<String, RBACManager> entry : beans.entrySet()) {
RBACManager rbacManager = applicationContext.getBean(entry.getKey(), RBACManager.class);
if (rbacManager.isFinalImplementation()) {
RBACManagerImplementationInformation information = new RBACManagerImplementationInformation();
information.setBeanId(StringUtils.substringAfter(entry.getKey(), "#"));
information.setDescriptionKey(rbacManager.getDescriptionKey());
information.setReadOnly(rbacManager.isReadOnly());
informations.add(information);
}
}
return informations;
}
Aggregations