I know I can do that, but there's no way do do it by inheritance? I have hundreds of anonymous subclasses throughout my application. Seems sensible that subclasses should inherit their parent's permissions.
On Thu, 2009-12-31 at 10:41 +0100, Olger Warnier wrote: > Hi Sam, > > I have added a sample to the secureform sample where the home page creates an > anonymous class of the MySecurePage > An anonymous page has a kind of a class name. Look for a > > ERROR - RequestCycle - Not authorized to instantiate class > org.apache.wicket.security.examples.secureform.pages.HomePage$2$1 > org.apache.wicket.authorization.UnauthorizedInstantiationException: Not > authorized to instantiate class > org.apache.wicket.security.examples.secureform.pages.HomePage$2$1 > > And add the line to the hive: > > permission ${ComponentPermission} > "org.apache.wicket.security.examples.secureform.pages.HomePage$2$1", "render, > enable"; > > As you can see it does not contain a line with the target response page but a > line that contains the setResponsePage call. > So you need to add a line that contains the 'name' of the anonymous class to > the hive. > > > Kind Regards, > > Olger > > > On 31 dec 2009, at 02:46, Sam Barrow wrote: > > > I hope this is the right list for wasp/swarm. > > How do i manage permissions for an anonymous subclass? > > > > I have a page called ItemPage. I can view ItemPage, but if I try to > > redirect to an anonymous subclass of ItemPage, i get an access denied > > error. > > > > this works: > > setResponsePage(new CreateItemPage(getPage())); > > > > but this doesnt: > > setResponsePage(new CreateItemPage(getPage()) { > > @Override > > protected void onSuccess(final Serializable index) { > > setResponsePage(new ViewItemPage(getBackPage(), index)); > > } > > }); > > > > hive file: > > > > permission ${ComponentPermission} "${pages}.CreateItemPage", "inherit, > > render"; > > permission ${ComponentPermission} "${pages}.CreateItemPage", "enable"; > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > > For additional commands, e-mail: users-h...@wicket.apache.org > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org