Shiro.ini file overview

1. Description of the Shiro.ini file

1. ini (InitializationFile) initial file. Window system file extension.

2. Shiro can connect to the database when using it or not.

        2.1 If you do not connect to the database, you can configure static data in shiro.ini



2. Components of the Shrio.ini file

1, [main]: define global variables

    1 Built-in securityManager object.

    2 When operating the built-in object, write something in [main]

2. [users]: define user name and password

[users] # Define the user name as zhangsan and password as zs zhangsan = zs

             # Define the username lisi password as lisi has both role1 and role2 roles lisi = lisi, role1, role2

3. [roles]: define roles

[roles] role1 = permission name 1, permission name 2 role2 = permission 3, permission 4

            如  [roles]   role1= user:query,  user:add,    user:update,   user:delete,   user:export     

                               role2=user:query,  user:add

4. [urls]: Define which built-in URLs take effect. Used in web applications.

[urls] #url address = built-in filter or custom filter

           # The URL of / login that appears during access must be authenticated. Support Filter / login = authc corresponding to authc

           # Any URL does not need to perform authentication and other functions. / ** = anon

           # All content must ensure that the user is logged in. / ** = user

           # url abc When accessing, you must ensure that users have role1 and role2 roles. / abc = roles [“role1, role2”]

authc represents the path that must be authenticated to access

Anon does not require authentication and other functions for any URL

All content of user must ensure that the user is logged in.

logout

Published 529 original articles · praised 115 · 90,000 views

Guess you like

Origin blog.csdn.net/qq_39368007/article/details/105594946