[ http://issues.apache.org/jira/browse/WICKET-21?page=comments#action_12456717 ] Erik van Oosten commented on WICKET-21: ---------------------------------------
Ok. That is fair. At least someone who want to do this can grab the code from this issue. > Inherit authorisation rules from base class > ------------------------------------------- > > Key: WICKET-21 > URL: http://issues.apache.org/jira/browse/WICKET-21 > Project: Wicket > Issue Type: Improvement > Components: wicket-auth-roles > Affects Versions: 1.2.2 > Reporter: Erik van Oosten > > Please make authorisation rules inheritable from the base class(es) of a > component. > The following change will allow you to define authorization rules on some > class. All sub-classes will automatically inherit these authorization rules. > It is easy to override this by explicitly adding authorization rules for a > subclass. > Change InstantiationPermissions#authorizedRoles to: > // TODO: make java 5 code by inserting generics again > public Roles authorizedRoles(final Class componentClass) { > if (componentClass == null) { > throw new IllegalArgumentException("Argument componentClass > cannot be null"); > } > Class c = componentClass; > while (Component.class.isAssignableFrom (c) && > !rolesForComponentClass.containsKey(c)) { > c = c.getSuperclass(); > } > return (Roles) rolesForComponentClass.get(c); > } > This has been tested under a jrocket 1.4 jvm. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira