incubator-jspwiki-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dirk Frederickx" <dirk.frederi...@gmail.com>
Subject Re: create a new page from a template?
Date Thu, 10 Jul 2008 08:02:51 GMT
Cloning is just build in the plain.jsp, it is not a plugin.
It was added with the inclusing of the BrushedTemplate.
(ref. http://www.jspwiki.org/wiki/BrushedTemplateClonePage)



dirk

On Thu, Jul 10, 2008 at 3:01 AM, Bob Paige <bobpaige@gmail.com> wrote:
> Is cloning a new feature in JSPWiki, or a plugin? I'm using 2.6.3.
>
> --
> Bobman
>
> On Wed, Jul 9, 2008 at 2:43 PM, Dirk Frederickx <dirk.frederickx@gmail.com>
> wrote:
>
>> > As far as security, I can imagine someone might try to view a page they
>> > otherwise don't have access to by creating a 'clone' of it (as Dirk
>> > suggests; I like that terminology, BTW). But isn't it possible to check
>> the
>> > permissions for the original page within the plugin? I think I've seen
>> that
>> > in the code I've been looking at so far.
>>
>> Good point! I need to add e permission check around the cloning
>> functionality (next commit)
>> Here is how you can do it yourself :
>>
>>
>>  String clone = request.getParameter( "clone" );
>>  if( clone != null )
>>  {
>>    WikiPage p = engine.getPage( clone );
>>    if( p != null )
>>    {
>>        AuthorizationManager mgr = engine.getAuthorizationManager();
>>        PagePermission pp = new PagePermission( p,
>> PagePermission.VIEW_ACTION );
>>
>>        try
>>        {
>>          if( mgr.checkPermission( context.getWikiSession(), pp ) )
>>          {
>>            usertext = engine.getPureText( p );
>>          }
>>        }
>>        catch( Exception e ) {  /*log.error( "Accessing clone page
>> "+clone, e );*/ }
>>    }
>>  }
>>
>> dirk
>>
>

Mime
View raw message