You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Erik van Oosten (JIRA)" <ji...@apache.org> on 2006/10/27 08:38:16 UTC

[jira] Created: (WICKET-21) Inherit authorisation rules from base class

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

        

[jira] Resolved: (WICKET-21) Inherit authorisation rules from base class

Posted by "Eelco Hillenius (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/WICKET-21?page=all ]

Eelco Hillenius resolved WICKET-21.
-----------------------------------

    Resolution: Won't Fix

A similar request was done here https://sourceforge.net/tracker/?func=detail&atid=684977&aid=1534600&group_id=119783 like Jean-Baptiste pointed out. The wicket-auth-roles project is primarily meant as an example of how you could implement a custom autorization strategy. We'd like to keep it simple and low on ambiguity.


> 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

        

[jira] Commented: (WICKET-21) Inherit authorisation rules from base class

Posted by "Jean-Baptiste Quenot (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/WICKET-21?page=comments#action_12450224 ] 
            
Jean-Baptiste Quenot commented on WICKET-21:
--------------------------------------------

I also proposed that a while ago:

See http://www.nabble.com/--wicket-Patches-1534600---auth-roles%3A-allow-subclasses-in-InstantiationPermissions-tf2051536.html#a5651528

But eelco raised various concerns, notably backwards compatilibity, so we finally agreed to just relax the method signatures of InstantiationPermissions to allow extension/customization of this class.

See WICKET-73

> 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

        

[jira] Closed: (WICKET-21) Inherit authorisation rules from base class

Posted by "Eelco Hillenius (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/WICKET-21?page=all ]

Eelco Hillenius closed WICKET-21.
---------------------------------


> 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

        

[jira] Commented: (WICKET-21) Inherit authorisation rules from base class

Posted by "Erik van Oosten (JIRA)" <ji...@apache.org>.
    [ 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