4

How can I configure the Roles in the addFilterChain Method??

in the INI file it is something like

[url]
/secure/** = authc, roles[admin]

How would it be in the Java method?

addFilterChain("/secure/**", ROLES);
Roman C
  • 49,761
  • 33
  • 66
  • 176

1 Answers1

3

The ShiroWebModule provides a "config" method that mimics the INI [] syntax.

So the equivalent of your INI config would be:

addFilterChain("/secure/**", AUTHC, config(ROLES, "admin"));
jbunting
  • 886
  • 5
  • 10