shiro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ken in Nashua <kcola...@live.com>
Subject chicken or egg first dilemma - how to assign perms to user
Date Fri, 22 Mar 2013 21:28:29 GMT
Folks,
I defined some default roles and perms.
        // roles
        configuration.add(factory.createChain("/roles/anonymous/**").add(factory.roles(),
"anonymous").build());
        configuration.add(factory.createChain("/roles/administrator/**").add(factory.roles(),
"administrator").build());
        
        // permissions
        configuration.add(factory.createChain("/perms/create/**").add(factory.perms(), "*:create:*").build());
        configuration.add(factory.createChain("/perms/read/**").add(factory.perms(), "*:read:*").build());
        configuration.add(factory.createChain("/perms/update/**").add(factory.perms(), "*:update:*").build());
        configuration.add(factory.createChain("/perms/delete/**").add(factory.perms(), "*:delete:*").build());
        

I defined users in my filterchain.

        //users
        configuration.add(factory.createChain("/user/localuser").add(factory.user(), "local:administrator").build());
        configuration.add(factory.createChain("/user/administrator").add(factory.user(), "administrator:administrator").build());
        configuration.add(factory.createChain("/user/anonymous").add(factory.user(), "anonymous:anonymous").build());
        

But I am experiencing the chicken or egg first dilemma.

I cannot get to my home page because my administrator user has no privileges yet assigned
from the database.

So I need to assign them hardwired from shiro config in order to get my administrator account
logged in.

Can someone tell me how I can assign perms to these users in the filterchain definitions ?

Could this be it as follows:

configuration.add(factory.createChain("/users/administrator/**").add(factory.perms(), "*:create,*:read,*:update,*:delete").build());

Thanks

Ken
 		 	   		  
Mime
View raw message