You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shiro.apache.org by nhhockeyplayer nashua <nh...@hotmail.com> on 2013/03/16 20:41:29 UTC

can someone tell me which shiro config NOTATION is valid

#first try at which notation ??????????

# =======================
# Shiro INI configuration
# =======================

[main]
# Objects and their properties are defined here, 
# Such as the securityManager, Realms and anything
# else needed to build the SecurityManager

[users]
# The 'users' section is for simple deployments
# when you only need a small number of statically-defined 
# set of User accounts.
administrator = administrator,administrator
anonymous = anonymous,anonymous

[roles]
# The 'roles' section is for simple deployments
# when you only need a small number of statically-defined
# roles.
administrator = create,read,update,delete
anonymous = read,update

[urls]
# The 'urls' section is used for url-based security
# in web applications.  We'll discuss this section in the
# Web documentation

#second try at which notation ??????????

/authc/login = anon
/authc/** = authc

/user/login = anon
/user/** = user

/roles/administrator/** = roles[administrator]
/roles/anonymous/** = roles[anonymous]

/perms/create/** = perms[*:create]
/perms/read/** = perms[*:read]
/perms/update/** = perms[*:update]
/perms/delete/** = perms[*:delete]


#third try at which notation ??????????


user.administrator = administrator, administrator
user.anonymous = anonymous, anonymous

role.administrator = user:create
role.administrator = user:read
role.administrator = user:update
role.administrator = user:delete

role.anonymous = user:read
role.anonymous = user:update







#http://shiro.apache.org/authorization.html#Authorization-PermissionGranularity

 		 	   		  

RE: can someone tell me which shiro config NOTATION is valid

Posted by nhhockeyplayer nashua <nh...@hotmail.com>.
Well I got one answer...

tynamo-security is mandating the dot notation be used for keyes

glad to see some insistence on a format because my head is still spinnin

ExtendedPropertiesRealm defaultShiroRealm = new ExtendedPropertiesRealm("classpath:shiro.properties");
defaultShiroRealm.setName("default");
configuration.add(defaultShiroRealm);

The formats below produce the following error

    Exception constructing service 'WebSecurityManager': Error invoking service contribution method org.tynamo.examples.pphl.services.AppModule.contributeWebSecurityManager(Configuration, Authenticator, WebSecurityManager, SecurityAuthenticationListener, AuthenticatingRealm): Encountered unexpected key/value pair.  All keys must be prefixed with either 'user.' or 'role.'.so this stuff is now obsolete it appears
/roles/administrator/** = roles[administrator]
/roles/anonymous/** = roles[anonymous]

/perms/create/** = perms[*:create]
/perms/read/** = perms[*:read]
/perms/update/** = perms[*:update]
/perms/delete/** = perms[*:delete]

or at least insisting on a format that is consistent and easy to understand
?
Best regards 
and thanks... KEN

From: nhhockeyplayer@hotmail.com
To: user@shiro.apache.org
Subject: can someone tell me which shiro config NOTATION is valid
Date: Sat, 16 Mar 2013 15:41:29 -0400




#first try at which notation ??????????

# =======================
# Shiro INI configuration
# =======================

[main]
# Objects and their properties are defined here, 
# Such as the securityManager, Realms and anything
# else needed to build the SecurityManager

[users]
# The 'users' section is for simple deployments
# when you only need a small number of statically-defined 
# set of User accounts.
administrator = administrator,administrator
anonymous = anonymous,anonymous

[roles]
# The 'roles' section is for simple deployments
# when you only need a small number of statically-defined
# roles.
administrator = create,read,update,delete
anonymous = read,update

[urls]
# The 'urls' section is used for url-based security
# in web applications.  We'll discuss this section in the
# Web documentation

#second try at which notation ??????????

/authc/login = anon
/authc/** = authc

/user/login = anon
/user/** = user

/roles/administrator/** = roles[administrator]
/roles/anonymous/** = roles[anonymous]

/perms/create/** = perms[*:create]
/perms/read/** = perms[*:read]
/perms/update/** = perms[*:update]
/perms/delete/** = perms[*:delete]


#third try at which notation ??????????


user.administrator = administrator, administrator
user.anonymous = anonymous, anonymous

role.administrator = user:create
role.administrator = user:read
role.administrator = user:update
role.administrator = user:delete

role.anonymous = user:read
role.anonymous = user:update







#http://shiro.apache.org/authorization.html#Authorization-PermissionGranularity