Re: [xwiki-users] permissions/rights for printing

2009-02-20 Thread Vincent Massol
Hi,

On Feb 20, 2009, at 1:36 AM, Henning Sprang wrote:

 Hi,
 We decided to write an online book by using xWiki as the authoring  
 system.
 While we want to make it freely available, we'd like to restrict pdf
 and other printable output apart from plain html.
 (we might want to sell pdf outputs later, with watermarks, but that
 would be a different story - and we will probably go via Latex then).

 But current permissions seem only to make a distinction between
 view(including html, pdf, rtf, xml, ...) and edit.

 How would we go to add such a print right, and even differentiate
 pdf and .xar and other there?

One easy solution I can think of would be to prevent access to them by  
configuring your web server to deny some actions (*/export/.).

Apart from this you would have to modify some java code (the Action  
classes code).

Thanks
-Vincent
http://xwiki.com
http://xwiki.org
http://massol.net






___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] permissions/rights for printing

2009-02-20 Thread Guillaume Lerouge
Or you could add some code in the vm topmenu template to hide those actions
from non-admin users.

Guillaume

On Fri, Feb 20, 2009 at 9:46 AM, Vincent Massol vinc...@massol.net wrote:

 Hi,

 On Feb 20, 2009, at 1:36 AM, Henning Sprang wrote:

  Hi,
  We decided to write an online book by using xWiki as the authoring
  system.
  While we want to make it freely available, we'd like to restrict pdf
  and other printable output apart from plain html.
  (we might want to sell pdf outputs later, with watermarks, but that
  would be a different story - and we will probably go via Latex then).
 
  But current permissions seem only to make a distinction between
  view(including html, pdf, rtf, xml, ...) and edit.
 
  How would we go to add such a print right, and even differentiate
  pdf and .xar and other there?

 One easy solution I can think of would be to prevent access to them by
 configuring your web server to deny some actions (*/export/.).

 Apart from this you would have to modify some java code (the Action
 classes code).

 Thanks
 -Vincent
 http://xwiki.com
 http://xwiki.org
 http://massol.net






 ___
 users mailing list
 users@xwiki.org
 http://lists.xwiki.org/mailman/listinfo/users




-- 
Guillaume Lerouge
Product Manager - XWiki
Skype ID : wikibc
http://guillaumelerouge.com/
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] permissions/rights for printing

2009-02-20 Thread Henning Sprang
On Fri, Feb 20, 2009 at 9:46 AM, Vincent Massol vinc...@massol.net wrote:
 One easy solution I can think of would be to prevent access to them by
 configuring your web server to deny some actions (*/export/.).

O.K. we'll do that if we need it fast and the other way is taking too long.

 Apart from this you would have to modify some java code (the Action
 classes code).

That's probably what we're going to do then. I have to look at the
code sooner or later anyway for the other export stuff.

Thanks,
Henning
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] permissions/rights for printing

2009-02-20 Thread Henning Sprang
On Fri, Feb 20, 2009 at 10:12 AM, Guillaume Lerouge guilla...@xwiki.com wrote:
 Or you could add some code in the vm topmenu template to hide those actions
 from non-admin users.

But that would be hiding the links, while somebody who knows xWiki
could still call them, right?

Henning
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] permissions/rights for printing

2009-02-20 Thread Guillaume Lerouge
On Fri, Feb 20, 2009 at 10:15 AM, Henning Sprang
henning.spr...@gmail.comwrote:

 On Fri, Feb 20, 2009 at 10:12 AM, Guillaume Lerouge guilla...@xwiki.com
 wrote:
  Or you could add some code in the vm topmenu template to hide those
 actions
  from non-admin users.

 But that would be hiding the links, while somebody who knows xWiki
 could still call them, right?

Absolutely.
Guillaume


 Henning
 ___
 users mailing list
 users@xwiki.org
 http://lists.xwiki.org/mailman/listinfo/users




-- 
Guillaume Lerouge
Product Manager - XWiki
Skype ID : wikibc
http://guillaumelerouge.com/
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] permissions/rights for printing

2009-02-20 Thread Sergiu Dumitriu
Henning Sprang wrote:
 On Fri, Feb 20, 2009 at 9:46 AM, Vincent Massol vinc...@massol.net wrote:
 One easy solution I can think of would be to prevent access to them by
 configuring your web server to deny some actions (*/export/.).
 
 O.K. we'll do that if we need it fast and the other way is taking too long.
 
 Apart from this you would have to modify some java code (the Action
 classes code).
 
 That's probably what we're going to do then. I have to look at the
 code sooner or later anyway for the other export stuff.

The rights system is not modular yet, so you will have to change one
java class.

Look at
xwiki-core/src/main/java/com/xpn/xwiki/user/impl/xwiki/XWikiRightServiceImpl.java,
around line 106, there should be a line like:
actionMap.put(pdf, view);
and around line 115:
actionMap.put(export, view);

A quick solution is to replace view with admin. A better solution is
to replace view with export, but then you will have to also change
other java code and some skin files.

-- 
Sergiu Dumitriu
http://purl.org/net/sergiu/
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] permissions/rights for printing

2009-02-20 Thread Henning Sprang
Hi

On Fri, Feb 20, 2009 at 10:47 AM, Sergiu Dumitriu ser...@xwiki.com wrote:
 xwiki-core/src/main/java/com/xpn/xwiki/user/impl/xwiki/XWikiRightServiceImpl.java,
 around line 106, there should be a line like:
 actionMap.put(pdf, view);
 and around line 115:
 actionMap.put(export, view);

Thanks a lot for the detailed information! I'll be looking at it the
next few days - I will finally have to start setting up a development
environment for xWiki coding.

 A quick solution is to replace view with admin.

For start that would suffice.

 A better solution is
 to replace view with export, but then you will have to also change
 other java code and some skin files.

No problem for the long term. I'll have to change stuff in the skins
anyway. I'm thinking of a better commenting system - for example like
it is in the djangobook project:
http://djangobook.com/en/1.0/chapter01/

Thanks a lot,
Henning
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] permissions/rights for printing

2009-02-20 Thread Vincent Massol

On Feb 20, 2009, at 12:53 PM, Henning Sprang wrote:

 Hi

 On Fri, Feb 20, 2009 at 10:47 AM, Sergiu Dumitriu ser...@xwiki.com  
 wrote:
 xwiki-core/src/main/java/com/xpn/xwiki/user/impl/xwiki/ 
 XWikiRightServiceImpl.java,
 around line 106, there should be a line like:
 actionMap.put(pdf, view);
 and around line 115:
 actionMap.put(export, view);

 Thanks a lot for the detailed information! I'll be looking at it the
 next few days - I will finally have to start setting up a development
 environment for xWiki coding.

 A quick solution is to replace view with admin.

 For start that would suffice.

 A better solution is
 to replace view with export, but then you will have to also  
 change
 other java code and some skin files.

 No problem for the long term. I'll have to change stuff in the skins
 anyway. I'm thinking of a better commenting system - for example like
 it is in the djangobook project:
 http://djangobook.com/en/1.0/chapter01/

This is something Lucien started to work on, see
http://dev​.xwiki.org​/xwiki/bin​/view/Desi​gn/Annotat​ 
ionFeature

I don't know what's the status but if you want to help you're welcome!

Does someone know where the sources are for this?

Thanks
-Vincent
http://xwiki.com
http://xwiki.org
http://massol.net






___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] permissions/rights for printing

2009-02-20 Thread Henning Sprang
On Fri, Feb 20, 2009 at 1:41 PM, Vincent Massol vinc...@massol.net wrote:
 http://djangobook.com/en/1.0/chapter01/

 This is something Lucien started to work on, see
 http://dev.xwiki.org/xwiki/bin/view/Design/Annotat
 ionFeature

Ah, thanks for the hint!

 I don't know what's the status but if you want to help you're welcome!

I'll check it out!
(writing a mail with my ideas and questions to -dev when I got a bit into it).

Heninng
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users