oasp / oasp4j

The Open Application Standard Platform for Java
Apache License 2.0
60 stars 303 forks source link

access-control-schema.xml as Code #622

Closed hohwille closed 6 years ago

hohwille commented 6 years ago

We introduced a flexible mechanism to configure access groups and permissions. That is currently configured via access-control-schema.xml. However, for authorization in our code we use @RolesAllowed, etc. and need to reference permissions declared in the XML file. Therefore we introduced some generation of code artifacts declaring these as Java constants. In the end there is no value in using XML for this at all. Instead we should introduce a new mechanism as alternative to declare these constants as code with the following benefits:

In order to keep the java class replacing access-control-schema.xml as simple as possible we should introduce an abstract super-class that declares according (helper) methods as a kind of DSL.

Finally, it is important to keep compatibility so the access-control-schema.xml is still supported (as legacy) so that existing projects are not affected and will not break in any way.

hohwille commented 6 years ago

Merged PR #631. Therefore done.