You can now add policies to Resources, Orders and Activities:
<Policies>
<Policy Type="PlanningPolicy" Value="key:SimplePlanningPolicy" />
<Policy Type="ExecutionPolicy"
Value="java:li.strolch.policy.execution.TestSimulatedExecutionPolicy" />
<Policy Type="ConfirmationPolicy" Value="key:NoConfirmation" />
</Policies>
And now there is a PolicyHandler to get the Policy:
<Component>
<name>PolicyHandler</name>
<api>li.strolch.policy.PolicyHandler</api>
<impl>li.strolch.policy.DefaultPolicyHandler</impl>
<Properties>
<readPolicyFile>true</readPolicyFile>
<policyConfigFile>StrolchPolicies.xml</policyConfigFile>
</Properties>
</Component>
Which has its own configuration file:
<?xml version="1.0" encoding="UTF-8"?>
<StrolchPolicies>
<PolicyType Type="PlanningPolicy"
Api="li.strolch.policytest.TestPlanningPolicy">
<Policy Key="SimplePlanningPolicy"
Class="li.strolch.policytest.TestSimplePlanningPolicy" />
</PolicyType>
<PolicyType Type="ConfirmationPolicy"
Api="li.strolch.policytest.TestConfirmationPolicy">
<Policy Key="NoConfirmation"
Class="li.strolch.policytest.TestNoConfirmationPolicy" />
</PolicyType>
</StrolchPolicies>
Some tests are still broken at this state - will fix them in the next
commit
- Implemented PostgreSQL persistence
Still missing is the xml persistence implementation and fixing
the tests. Currently no tests were run, just trying to fix compile
errors
- Creating new maps for transient, transactional and cached mode
- adding to Realms; including initialization
- adding new methods to transactions e.g. getActivityBy(), etc.
- Adding new ActivityDao with InMemory implementation
- extending PersistenceHandler
- fixed compile errors in the rest of the project
Still missing is the implementation in persistence handler and fixing
the tests. Currently no tests were run, just trying to fix compile
errors
Now a SystemUserAction is defined as follows:
<Privilege name="ch.eitchnet.privilege.handler.SystemUserAction"
policy="DefaultPrivilege">
<Allow>li.strolch.agent.impl.StartRealms</Allow>
</Privilege>
elements is created programmatically and the time and values of the
changes is set by the programmmer. Note, that the persistence and xml
serialization is not implemented yet.
Now if you add the DefaultServiceHandler property 'throwOnPrivilegeFail'
and set it to true, then the service handler will throw a
StrolchAccessDeniedException which in combination with the
StrolchRestfulExceptionMapper allows rest services to quickly determine
if the error was because the user does not have access to the requested
resource.
Same goes for performing queries in AbstractTransaction only there
instead of throwing a privilege exception, we now also throw a
StrolchAccessDeniedException