You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shiro.apache.org by lbonacina <lb...@gmail.com> on 2012/12/10 16:58:56 UTC

Permissions Use Case and the printer example in the docs

hi,

i'm testing out Shiro for a new project and i'm trying to understand the
permission mechanism.
in the docs there is the printer example

if ( SecurityUtils.getSubject().isPermitted("printer:print") ) {
    //print the document
}

the docs says that for the check to pass you have to been enabled to print
on all printers, but what if i want to check if someone is enabled to print
on at least one printer ?
in the example i'm working on i have two roles, one that can access a user
page to do CRUD operations and one that can access the page to do only R,
but there is also a role (guest) that cannot access the page at all, how can
i test the permission for something like "grant me access to the page if i
can do something in C-R-U-D ?"
of course i can just test for R and the check works, or i can define another
permission like "user_page_access" and test for it, but i want to know if
there is simple solution to test this use case.

thanks

Luigi




--
View this message in context: http://shiro-user.582556.n2.nabble.com/Permissions-Use-Case-and-the-printer-example-in-the-docs-tp7578030.html
Sent from the Shiro User mailing list archive at Nabble.com.