Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@

<bean id="StaticRoleBasedAPIAccessChecker" class="org.apache.cloudstack.acl.StaticRoleBasedAPIAccessChecker" >
<property name="services" value="#{apiCommandsRegistry.registered}" />
<property name="commandPropertyFiles">
<set>
<value>commands.properties</value>
</set>
</property>
</bean>

</beans>
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public class StaticRoleBasedAPIAccessChecker extends AdapterBase implements APIC

protected static final Logger s_logger = Logger.getLogger(StaticRoleBasedAPIAccessChecker.class);

Set<String> commandPropertyFiles = new HashSet<String>();
Set<String> commandsPropertiesOverrides = new HashSet<String>();
Map<RoleType, Set<String>> commandsPropertiesRoleBasedApisMap = new HashMap<RoleType, Set<String>>();
Map<RoleType, Set<String>> annotationRoleBasedApisMap = new HashMap<RoleType, Set<String>>();
Expand Down Expand Up @@ -84,7 +85,9 @@ public boolean checkAccess(User user, String commandName) throws PermissionDenie
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
super.configure(name, params);

processMapping(PropertiesUtil.processConfigFile(new String[] {"commands.properties"}));
for (String commandPropertyFile : commandPropertyFiles) {
processMapping(PropertiesUtil.processConfigFile(new String[] { commandPropertyFile }));
}
return true;
}

Expand Down Expand Up @@ -129,4 +132,12 @@ public void setServices(List<PluggableService> services) {
this._services = services;
}

public Set<String> getCommandPropertyFiles() {
return commandPropertyFiles;
}

public void setCommandPropertyFiles(Set<String> commandPropertyFiles) {
this.commandPropertyFiles = commandPropertyFiles;
}

}