jspwiki-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roberto Venturi" <Ro...@Mercurio.It>
Subject How to test if a permission is a Wikipermission
Date Mon, 06 Aug 2012 14:21:09 GMT
another chapter of my "search of the holy grail" with JSPWiki &  
websphere security policies :-)

File: org.apache.auth.Authorization.Manager.java
Method: checkStaticPermission
             // Check the JVM-wide security policy first
             AccessController.checkPermission( permission );
             return Boolean.TRUE;
         catch( AccessControlException e )
the "return Boolean.TRUE;" can't be disabled (with "//") as I  
suggested in precedent email because it manages all "non wiki"  
permissions. So I need a test on "permission" to see if it's or not a  
"wiki permission".
I'm trying substituting the statement with a "brutal" block as
String pName = permission.getName();
if (pName==null || pName.length()<4 || !pName.substring(0,4).equals("Wiki"))
                     return Boolean.TRUE;
And, it was time, here is the question: there is a "more nice" way to  
do the test?

Tanks for your patience :-)

Messaggio inviato da WebMail - http://www.mercurio.it

View raw message