conf/security/access.conf
to your application’s configuration tree.
Use the following configuration parameters:
allow
: A comma-separated list of roles that should be granted access. When not specified or set to a wildcard (’*’), Appkit defaults to allowing access to all roles.deny
: A comma-separated list of roles that should be denied access.pattern
: A regular expression defining the pattern of URIs that should be intercepted for checking access. This defaults to .* (all paths are checked).user
and admin
, where only the latter has an ADMIN
role. For example, you can define this using a simple spring-security.xml
configuration with a static list of users like so:
conf/security/access.conf
to the application with this configuration:
/
(root page) and the API service we apply role-based authorization rules. The former is strictly not necessary, just leads to better UX for users denied access.
To validate this setup, first log in as user
and get denied access, as shown in the application logs:
admin
and get access to the app, as shown in the logs: