You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jspwiki.apache.org by Florian Holeczek <fl...@holeczek.de> on 2008/08/15 18:20:11 UTC

security configuration question

Hi all,

I've just set up a public wiki which should only be accessible to
authenticated users. However, every visitor should be able to sign in.
He's then approved via the user creation workflow.

Protecting the wiki content from unauthenticated users works - but
unfortunately, neither authenticated users nor the administrator can
edit pages. Either there's no error message at all (meaning the page
content simply won't be changed) or there's an error message "you're
not allowed to do that.

Here's some part of my log:

> 2008-08-15 18:09:01,596 [httpSSLWorkerThread-8080-1] INFO
> SecurityLog BNV-GZ Wiki:/Login.jsp BNV-GZ
> Wiki:http://wiki.bnv-gz.de:8080/Login.jsp -
> WikiSecurityEvent.LOGIN_AUTHENTICATED
> [source=com.ecyrd.jspwiki.auth.AuthenticationManager@1af2bc,
> princpal=com.ecyrd.jspwiki.auth.WikiPrincipal admin,
> target=com.ecyrd.jspwiki.WikiSession@8f9a4f]
> 2008-08-15 18:09:01,597 [httpSSLWorkerThread-8080-1] INFO JSPWiki
> BNV-GZ Wiki:/Login.jsp BNV-GZ
> Wiki:http://wiki.bnv-gz.de:8080/Login.jsp - Successfully
> authenticated user admin (custom auth)
> 2008-08-15 18:09:01,599 [httpSSLWorkerThread-8080-1] INFO JSPWiki
> BNV-GZ Wiki:/Login.jsp BNV-GZ
> Wiki:http://wiki.bnv-gz.de:8080/Login.jsp - Redirecting user to
> http://wiki.bnv-gz.de:8080/wiki/Main
> 2008-08-15 18:09:01,678 [httpSSLWorkerThread-8080-0] INFO
> com.ecyrd.jspwiki.WikiServlet BNV-GZ Wiki:/wiki/Main BNV-GZ
> Wiki:http://wiki.bnv-gz.de:8080/wiki/Main - Request for page: Main
> 2008-08-15 18:09:06,810 [httpSSLWorkerThread-8080-1] INFO
> com.ecyrd.jspwiki.WikiServlet BNV-GZ Wiki:/wiki/SandBox BNV-GZ
> Wiki:http://wiki.bnv-gz.de:8080/wiki/SandBox - Request for page: SandBox
> 2008-08-15 18:09:08,807 [httpSSLWorkerThread-8080-0] INFO JSPWiki
> BNV-GZ Wiki:/Edit.jsp BNV-GZ
> Wiki:http://wiki.bnv-gz.de:8080/Edit.jsp - Editing page SandBox.
> User=Administrator, host=91.47.176.42
> 2008-08-15 18:09:24,462 [httpSSLWorkerThread-8080-0] INFO JSPWiki
> BNV-GZ Wiki:/Edit.jsp BNV-GZ
> Wiki:http://wiki.bnv-gz.de:8080/Edit.jsp - Saving page SandBox.
> User=Administrator, host=91.47.176.42
> 2008-08-15 18:09:24,545 [httpSSLWorkerThread-8080-1] INFO
> com.ecyrd.jspwiki.WikiServlet BNV-GZ Wiki:/wiki/SandBox BNV-GZ
> Wiki:http://wiki.bnv-gz.de:8080/wiki/SandBox - Request for page: SandBox

This is my jspwiki.policy:
---
grant principal com.ecyrd.jspwiki.auth.authorize.Role "All" {
    permission com.ecyrd.jspwiki.auth.permissions.WikiPermission "*", "editPreferences";
    permission com.ecyrd.jspwiki.auth.permissions.WikiPermission "*", "editProfile";
    permission com.ecyrd.jspwiki.auth.permissions.WikiPermission "*", "login";
};

grant principal com.ecyrd.jspwiki.auth.authorize.Role "Anonymous" {
};

grant principal com.ecyrd.jspwiki.auth.authorize.Role "Asserted" {
};

grant principal com.ecyrd.jspwiki.auth.authorize.Role "Authenticated" {
    permission com.ecyrd.jspwiki.auth.permissions.PagePermission "*:*", "view,rename";
    permission com.ecyrd.jspwiki.auth.permissions.GroupPermission "*:*", "view";
    permission com.ecyrd.jspwiki.auth.permissions.GroupPermission "*:<groupmember>", "edit";
    permission com.ecyrd.jspwiki.auth.permissions.WikiPermission "*", "createPages,createGroups";
};

grant principal com.ecyrd.jspwiki.auth.GroupPrincipal "Admin" {
    permission com.ecyrd.jspwiki.auth.permissions.AllPermission "*";
};
grant principal com.ecyrd.jspwiki.auth.authorize.Role "Admin" {
    permission com.ecyrd.jspwiki.auth.permissions.AllPermission "*";
};
---

What am I doing wrong?
Thanks in advance!

Best Regards
 Florian

Re: weird access rights issue, was: Re: security configuration question

Posted by Florian Holeczek <fl...@holeczek.de>.
> if we would push the latest version to the Sandbox, would you be
> able to recreate the problem there ?

As far as I've seen, the problem can be reproduced with the set of
german core pages from the trunk. At least I could reproduce it with
these under two completely different environments.

I didn't have a look at the tests and have never run them, but I guess
they're working with a bunch of test pages. Would it be hard to modify
them towards using the german core pages? As I wrote, it isn't
neccessary that *only* these pages are used; additional pages didn't
prevent the error from appearing.

Generally I'm not surprised that the current tests don't detect this
error. To me it seems to be a
http://en.wikipedia.org/wiki/Unusual_software_bug#Ghost_in_the_code

Regards
 Florian


Re: weird access rights issue, was: Re: security configuration question

Posted by Harry Metske <ha...@gmail.com>.
Florian,

if we would push the latest version to the Sandbox, would you be able to
recreate the problem there ?



2008/8/19 Andrew Jaquith <an...@me.com>

> I really don't know what to say about this. We have lots and lots of unit
> tests for ACLs, and many web unit tests that test things from the browser.
>
> All of these tests work fine.
>
> Unless we can devise some tests that allow reproduction of the issue, every
> time, it's going to be hard for me to help.
>
> Florian, I do not doubt that you are having
>
>
> On Aug 19, 2008, at 8:14 AM, Florian Holeczek <fl...@holeczek.de> wrote:
>
>  Interesting... in my case, the affected pages are viewable, but
>> nothing more. Also, administrators do have full access to it like they
>> should.
>>
>> I have some "allow view all" page ACLs in the pages. Could you check
>> for page ACLs maybe in a backup from the time when you had the
>> problem? Maybe the ACLs shift somehow in memory.
>>
>> This brought me to the idea of testing it without the page cache.
>> This is spooky...
>> Without cache, the error appears in another way.
>> * Pages appear with their correct ACLs. They were editable, but: The
>>  changes aren't saved!
>> * However, no error appears, JSPWiki is behaving as if the save action
>>  has been handled correctly.
>> * Adding comments to these pages works, but the comment itself isn't
>>  written into the page, only the signature.
>>
>> Like Janne assumed, this could in fact be related to JSPWIKI-27.
>> However, the problem described there isn't that dramatic, but the
>> "full error" I'm describing here is pretty severe, I think.
>>
>> I'm experiencing the problem with the current head of trunk (alpha-21
>> at the moment).
>>
>> Andrew, what do you think about it? AFAIK you're the AAA expert in
>> here.
>>
>> Regards
>> Florian
>>
>> Ursprüngliche Nachricht vom 19.08.2008 um 10:18:
>>
>>> Florian,
>>>
>>
>>  I think we had similar problems in the past (unfortunately my long term
>>> memory is bad).
>>> The symptoms were that (mostly) the main page was not publicly accessible
>>> anymore, only for administrators.
>>> Looking at the source of the page, there were no ACL's on it.
>>> The workaround for this was always Edit the page (add something to it)
>>> and
>>> save it.
>>> This problem occurred on average 3 times a week.
>>>
>>
>>  The problem was solved after an upgrade, but I don't know anymore to
>>> which
>>> version (you can see the version history on my personal page on
>>> jspwiki.org
>>> ).
>>>
>>
>>  We currently run 2.7.0-svn-44, and we don't have the problem anymore.
>>>
>>
>>  Hope this helps,
>>> Harry
>>>
>>
>>


-- 
met vriendelijke groet,
Harry Metske
Telnr. +31-548-512395
Mobile +31-6-51898081

Re: Javascript jollies (was: weird access rights issue)

Posted by Andrew Jaquith <an...@me.com>.
Selenium would help immensely. During the 2.8 coding cycle, I  
refactored the web unit tests so that they would run without any  
external dependencies. The rationale was that we needed to make it  
easier to create and run web unit tests. Certainly, we can (and  
should) use Selenium more to test JavaScript functionality.

The nice thing about Selenium is that you can use the Firefox Selenium- 
IDE plugin to "record" the test session. Then, with a little light  
editing you can turn it into test that runs as part of the "webtests"  
Ant target. See the mostly-accurate docs in tests/etc/selenium/ 
readme.txt.

The bad thing about Selenium is that it does NOT seem to work with  
Firefox 3 yet. However, Firefox 2, IE, Safari etc. seem to work fine.

Regarding the other comments about JavaScript dependencies in JSPWiki,  
everyone has made good points so far. I agree that we will need move  
certain functions from the client to the server at some point --  
ESPECIALLY for any client-side code that manipulates session state. By  
"manipulating session state," I MOSTLY mean server-side (JSP, servlet,  
core) code whose processing depends on client-supplied cookies.

In the short term, we should probably file JIRA issues as reminders  
for things that should be moved.

Andrew

On Aug 20, 2008, at 12:15 PM, Harry Metske wrote:

> The point is that we don't do enough automated testing, it would be  
> nice if
> we had some kind of JUnit tests for JS.
> Can the selenium tests do something here ?
> What is the "industry standard" for JS testing ?
>
> I, also like to keep all the goodies of JS in JSPWiki on board, and  
> let's
> get to the Stripes release as soon as we can.
>
> regards,
> Harry
>
> 2008/8/20 Janne Jalkanen <Ja...@ecyrd.com>
>
>>
>> On Aug 20, 2008, at 04:42 , Terry Steichen wrote:
>>
>> I've been wondering for some time if JSPWiki hasn't become somewhat  
>> too
>>> dependent on esoteric Javascript code for its core functionality.   
>>> Dirk
>>> has done a wonderful job - of that, there's absolutely no doubt.   
>>> When
>>> the template logic works (as it normally does quite well), it's a  
>>> marvel
>>> to behold.
>>>
>>> But when it doesn't, it's sometimes a nightmare to figure out.   
>>> I'm OK
>>> figuring out Java, servlets, HTML and the like - even with its poor
>>> documentation, I can eventually figure out the innards of JSPWiki  
>>> code.
>>> But the increasingly complex Javascript will often does me in.
>>>
>>
>> I think the problem partly stems from the fact that Dirk is the  
>> only one
>> doing the JS hacking.  With the Java code, it's a shared effort by  
>> many
>> people, so it tends to stay readable across for least a few people,  
>> which
>> makes it readable to the rest as well.
>>
>> I think we need a few more Javascript hackers ;-)
>>
>> (And also we'll need to think which of the JS functionalities would  
>> be
>> better done server-side.  For example, I think section editing  
>> would be
>> nicer to do server-side, not client-side - for the simple reason  
>> that then
>> we could also lock parts of the page, or also be completely  
>> collaborative.)
>>
>> /Janne
>>
>
>
>
> -- 
> met vriendelijke groet,
> Harry Metske
> Telnr. +31-548-512395
> Mobile +31-6-51898081


Re: Javascript jollies (was: weird access rights issue)

Posted by Harry Metske <ha...@gmail.com>.
The point is that we don't do enough automated testing, it would be nice if
we had some kind of JUnit tests for JS.
Can the selenium tests do something here ?
What is the "industry standard" for JS testing ?

I, also like to keep all the goodies of JS in JSPWiki on board, and let's
get to the Stripes release as soon as we can.

regards,
Harry

2008/8/20 Janne Jalkanen <Ja...@ecyrd.com>

>
> On Aug 20, 2008, at 04:42 , Terry Steichen wrote:
>
>  I've been wondering for some time if JSPWiki hasn't become somewhat too
>> dependent on esoteric Javascript code for its core functionality.  Dirk
>> has done a wonderful job - of that, there's absolutely no doubt.  When
>> the template logic works (as it normally does quite well), it's a marvel
>> to behold.
>>
>> But when it doesn't, it's sometimes a nightmare to figure out.  I'm OK
>> figuring out Java, servlets, HTML and the like - even with its poor
>> documentation, I can eventually figure out the innards of JSPWiki code.
>> But the increasingly complex Javascript will often does me in.
>>
>
> I think the problem partly stems from the fact that Dirk is the only one
> doing the JS hacking.  With the Java code, it's a shared effort by many
> people, so it tends to stay readable across for least a few people, which
> makes it readable to the rest as well.
>
> I think we need a few more Javascript hackers ;-)
>
> (And also we'll need to think which of the JS functionalities would be
> better done server-side.  For example, I think section editing would be
> nicer to do server-side, not client-side - for the simple reason that then
> we could also lock parts of the page, or also be completely collaborative.)
>
> /Janne
>



-- 
met vriendelijke groet,
Harry Metske
Telnr. +31-548-512395
Mobile +31-6-51898081

Re: Javascript jollies (was: weird access rights issue)

Posted by Florian Holeczek <fl...@holeczek.de>.
Hallo Janne,

> For example, I think section editing would be nicer to do
> server-side, not client-side - for the simple reason that then we
> could also lock parts of the page, or also be completely
> collaborative.)

I think so, too... So you've already found something that isn't
covered by JCR. Who thought that a wiki could become that
sophisticated :-)

Regards
 Florian


Re: Javascript jollies (was: weird access rights issue)

Posted by Janne Jalkanen <Ja...@ecyrd.com>.
On Aug 20, 2008, at 04:42 , Terry Steichen wrote:

> I've been wondering for some time if JSPWiki hasn't become somewhat  
> too
> dependent on esoteric Javascript code for its core functionality.   
> Dirk
> has done a wonderful job - of that, there's absolutely no doubt.  When
> the template logic works (as it normally does quite well), it's a  
> marvel
> to behold.
>
> But when it doesn't, it's sometimes a nightmare to figure out.  I'm OK
> figuring out Java, servlets, HTML and the like - even with its poor
> documentation, I can eventually figure out the innards of JSPWiki  
> code.
> But the increasingly complex Javascript will often does me in.

I think the problem partly stems from the fact that Dirk is the only  
one doing the JS hacking.  With the Java code, it's a shared effort  
by many people, so it tends to stay readable across for least a few  
people, which makes it readable to the rest as well.

I think we need a few more Javascript hackers ;-)

(And also we'll need to think which of the JS functionalities would  
be better done server-side.  For example, I think section editing  
would be nicer to do server-side, not client-side - for the simple  
reason that then we could also lock parts of the page, or also be  
completely collaborative.)

/Janne

Re: Javascript jollies (was: weird access rights issue)

Posted by Janne Jalkanen <Ja...@ecyrd.com>.
> 1) JSPWiki should be able to run without JS active; you'll only miss
> some ''not-essential'' functionality, such as presentational
> enhancements, table sorting, etc.
> Browser specific stuff runs on the client.  All gui stuff relies on
> html and css to a maximum extend.

Yup, this is exactly correct.  As it should be.

>
> And I know, documentation could be improved :-)

I guess this is my gripe.  I can see *what* is being done, but not  
*why* :-)

> I agree that in some cases the current JS weight of the CORE jspwiki
> is to much. Especially imho some of the dynamic styles should not be
> part of the core jpswiki package.  I would like to see a kind of
> pluggable approach to allow users to add js-pieces they need. (similar
> to server side plugins)

Yup, we're in agreement here.  Of course, adding a lot of small JS  
files can have a performance hit when they are loaded from the server  
(opening new connections can be expensive).  But we could keep them  
separate for coding, and then have the build process create a  
concatenation.

/Janne

Re: Javascript jollies

Posted by Terry Steichen <te...@net-frame.com>.
Dirk,

Good thoughts.  I agree entirely.

Terry

On Wed, 2008-08-20 at 12:44 +0200, Dirk Frederickx wrote:

> Hi Terry,
> 
> Maybe JS is esoteric for many of the jspwiki folks ...  as the core of
> jspwiki is around java.  But by incorporating the brushed-template as
> default, we of-course also added some extra js weight to jspwiki.
> Alternatively jspwiki could choose to go java all the way and eg go
> for GWT kind of technology.  Personally I think JS is pretty
> accessible (and readable) and shoudl not cause to much of a burden to
> java-developers ---- but of course who am I to say so :-)
> 
> 
> v2.7.x is still in alpha, and we are ironing out the last bugs.
> Section Editing was added, and still caused issues wrt to adding
> comments.  And sometimes bugs only come to the surface in strange
> ways.
> 
> 
> The approach I try to take wrt to JS is the following:
> 
> 
> 1) JSPWiki should be able to run without JS active; you'll only miss
> some ''not-essential'' functionality, such as presentational
> enhancements, table sorting, etc.
> Browser specific stuff runs on the client.  All gui stuff relies on
> html and css to a maximum extend.
> 
> 2) The JS is *supposed* to be written in a modular way so it should be
> rather straighforward to selectively remove the parts of the js which
> you think you don't need or are bothering you.
> This requires of course JS-know-how. And some knowledge how the
> jspwiki JS is hooked into JSPWiki, and interacts with the back-end.
> And I know, documentation could be improved :-)
> 
> 
> I agree that in some cases the current JS weight of the CORE jspwiki
> is to much. Especially imho some of the dynamic styles should not be
> part of the core jpswiki package.  I would like to see a kind of
> pluggable approach to allow users to add js-pieces they need. (similar
> to server side plugins)
> 
> 
> 
> dirk
> 
> On 8/20/08, Terry Steichen <te...@net-frame.com> wrote:
> > I've been wondering for some time if JSPWiki hasn't become somewhat too
> > dependent on esoteric Javascript code for its core functionality.  Dirk
> > has done a wonderful job - of that, there's absolutely no doubt.  When
> > the template logic works (as it normally does quite well), it's a marvel
> > to behold.
> >
> > But when it doesn't, it's sometimes a nightmare to figure out.  I'm OK
> > figuring out Java, servlets, HTML and the like - even with its poor
> > documentation, I can eventually figure out the innards of JSPWiki code.
> > But the increasingly complex Javascript will often does me in.
> >
> > On Tue, 2008-08-19 at 21:51 +0200, Dirk Frederickx wrote:
> >
> > > Janne,
> > >
> > > The 2nd textarea is inserted to allow section-editing.
> > > Just 'kill' jspwiki-eidt.js to get rid of it.  (eg. commenting the
> > > last line of jspwiki-edit.js will do the trick -- remove
> > > window.addEvent ....)
> > >
> > >
> > > dirk
> > >
> > > On Tue, Aug 19, 2008 at 9:43 PM, Janne Jalkanen
> > > <Ja...@ecyrd.com> wrote:
> > > >
> > > > On 19 Aug 2008, at 22:35, Janne Jalkanen wrote:
> > > >
> > > >>>
> > > >>> Not because of ACLs, but because request.getParameter() is returning the
> > > >>> *page content without edits*.  This should NOT be happening.
> > > >>
> > > >> Looks like our Javascript is inserting an extraneous <textarea> without an
> > > >> id, and putting the edit content in it.  Ugh.  Hard to debug.
> > > >
> > > > I would really like to understand what is going on with the editor.  Why are
> > > > there two textareas created programmatically?
> > > >
> > > > /Janne
> > > >
> >

Re: Javascript jollies (was: weird access rights issue)

Posted by Dirk Frederickx <di...@gmail.com>.
Hi Terry,

Maybe JS is esoteric for many of the jspwiki folks ...  as the core of
jspwiki is around java.  But by incorporating the brushed-template as
default, we of-course also added some extra js weight to jspwiki.
Alternatively jspwiki could choose to go java all the way and eg go
for GWT kind of technology.  Personally I think JS is pretty
accessible (and readable) and shoudl not cause to much of a burden to
java-developers ---- but of course who am I to say so :-)


v2.7.x is still in alpha, and we are ironing out the last bugs.
Section Editing was added, and still caused issues wrt to adding
comments.  And sometimes bugs only come to the surface in strange
ways.


The approach I try to take wrt to JS is the following:


1) JSPWiki should be able to run without JS active; you'll only miss
some ''not-essential'' functionality, such as presentational
enhancements, table sorting, etc.
Browser specific stuff runs on the client.  All gui stuff relies on
html and css to a maximum extend.

2) The JS is *supposed* to be written in a modular way so it should be
rather straighforward to selectively remove the parts of the js which
you think you don't need or are bothering you.
This requires of course JS-know-how. And some knowledge how the
jspwiki JS is hooked into JSPWiki, and interacts with the back-end.
And I know, documentation could be improved :-)


I agree that in some cases the current JS weight of the CORE jspwiki
is to much. Especially imho some of the dynamic styles should not be
part of the core jpswiki package.  I would like to see a kind of
pluggable approach to allow users to add js-pieces they need. (similar
to server side plugins)



dirk

On 8/20/08, Terry Steichen <te...@net-frame.com> wrote:
> I've been wondering for some time if JSPWiki hasn't become somewhat too
> dependent on esoteric Javascript code for its core functionality.  Dirk
> has done a wonderful job - of that, there's absolutely no doubt.  When
> the template logic works (as it normally does quite well), it's a marvel
> to behold.
>
> But when it doesn't, it's sometimes a nightmare to figure out.  I'm OK
> figuring out Java, servlets, HTML and the like - even with its poor
> documentation, I can eventually figure out the innards of JSPWiki code.
> But the increasingly complex Javascript will often does me in.
>
> On Tue, 2008-08-19 at 21:51 +0200, Dirk Frederickx wrote:
>
> > Janne,
> >
> > The 2nd textarea is inserted to allow section-editing.
> > Just 'kill' jspwiki-eidt.js to get rid of it.  (eg. commenting the
> > last line of jspwiki-edit.js will do the trick -- remove
> > window.addEvent ....)
> >
> >
> > dirk
> >
> > On Tue, Aug 19, 2008 at 9:43 PM, Janne Jalkanen
> > <Ja...@ecyrd.com> wrote:
> > >
> > > On 19 Aug 2008, at 22:35, Janne Jalkanen wrote:
> > >
> > >>>
> > >>> Not because of ACLs, but because request.getParameter() is returning the
> > >>> *page content without edits*.  This should NOT be happening.
> > >>
> > >> Looks like our Javascript is inserting an extraneous <textarea> without an
> > >> id, and putting the edit content in it.  Ugh.  Hard to debug.
> > >
> > > I would really like to understand what is going on with the editor.  Why are
> > > there two textareas created programmatically?
> > >
> > > /Janne
> > >
>

Javascript jollies (was: weird access rights issue)

Posted by Terry Steichen <te...@net-frame.com>.
I've been wondering for some time if JSPWiki hasn't become somewhat too
dependent on esoteric Javascript code for its core functionality.  Dirk
has done a wonderful job - of that, there's absolutely no doubt.  When
the template logic works (as it normally does quite well), it's a marvel
to behold.  

But when it doesn't, it's sometimes a nightmare to figure out.  I'm OK
figuring out Java, servlets, HTML and the like - even with its poor
documentation, I can eventually figure out the innards of JSPWiki code.
But the increasingly complex Javascript will often does me in.

On Tue, 2008-08-19 at 21:51 +0200, Dirk Frederickx wrote:

> Janne,
> 
> The 2nd textarea is inserted to allow section-editing.
> Just 'kill' jspwiki-eidt.js to get rid of it.  (eg. commenting the
> last line of jspwiki-edit.js will do the trick -- remove
> window.addEvent ....)
> 
> 
> dirk
> 
> On Tue, Aug 19, 2008 at 9:43 PM, Janne Jalkanen
> <Ja...@ecyrd.com> wrote:
> >
> > On 19 Aug 2008, at 22:35, Janne Jalkanen wrote:
> >
> >>>
> >>> Not because of ACLs, but because request.getParameter() is returning the
> >>> *page content without edits*.  This should NOT be happening.
> >>
> >> Looks like our Javascript is inserting an extraneous <textarea> without an
> >> id, and putting the edit content in it.  Ugh.  Hard to debug.
> >
> > I would really like to understand what is going on with the editor.  Why are
> > there two textareas created programmatically?
> >
> > /Janne
> >

Re: weird access rights issue, was: Re: security configuration question

Posted by Dirk Frederickx <di...@gmail.com>.
Janne,

The 2nd textarea is inserted to allow section-editing.
Just 'kill' jspwiki-eidt.js to get rid of it.  (eg. commenting the
last line of jspwiki-edit.js will do the trick -- remove
window.addEvent ....)


dirk

On Tue, Aug 19, 2008 at 9:43 PM, Janne Jalkanen
<Ja...@ecyrd.com> wrote:
>
> On 19 Aug 2008, at 22:35, Janne Jalkanen wrote:
>
>>>
>>> Not because of ACLs, but because request.getParameter() is returning the
>>> *page content without edits*.  This should NOT be happening.
>>
>> Looks like our Javascript is inserting an extraneous <textarea> without an
>> id, and putting the edit content in it.  Ugh.  Hard to debug.
>
> I would really like to understand what is going on with the editor.  Why are
> there two textareas created programmatically?
>
> /Janne
>

Re: weird access rights issue, was: Re: security configuration question

Posted by Janne Jalkanen <Ja...@ecyrd.com>.
On 19 Aug 2008, at 22:35, Janne Jalkanen wrote:

>>
>> Not because of ACLs, but because request.getParameter() is  
>> returning the *page content without edits*.  This should NOT be  
>> happening.
>
> Looks like our Javascript is inserting an extraneous <textarea>  
> without an id, and putting the edit content in it.  Ugh.  Hard to  
> debug.

I would really like to understand what is going on with the editor.   
Why are there two textareas created programmatically?

/Janne

Re: weird access rights issue, was: Re: security configuration question

Posted by Janne Jalkanen <Ja...@ecyrd.com>.
>
> Not because of ACLs, but because request.getParameter() is  
> returning the *page content without edits*.  This should NOT be  
> happening.

Looks like our Javascript is inserting an extraneous <textarea>  
without an id, and putting the edit content in it.  Ugh.  Hard to debug.

/Janne

Re: weird access rights issue, was: Re: security configuration question

Posted by Florian Holeczek <fl...@holeczek.de>.
Hallo everybody,

I've finally found out what's the problem.

I'd suggest we close this thread now, because it has become a bit
confusing and contains many presumptions and half-truths.

Please see JSPWIKI-352 for details on the access rights problem. I
didn't track it down to the source code, but I think this will be
quite easy now.

Happy debugging!

 Florian


Re: weird access rights issue, was: Re: security configuration question

Posted by Janne Jalkanen <Ja...@ecyrd.com>.
>
> Well, at least this bug appears even with only one user.
> I know nothing about how the page content is processed, but my idea is
> that the bug is caused by this data somehow (which is why I've been
> referring to the ghost in the code, not the heisenbug... I've been
> thinking of this one before, too). Maybe in conjunction with
> page ACLs. I'll check if removing the core pages "heals" the wiki
> again and if so, I'll try to determine which part of the core pages
> causes the effect.

I managed to get something *very* strange happening with the german  
corepages: after a few edits, it has become impossible to edit the  
Main page.

Not because of ACLs, but because request.getParameter() is returning  
the *page content without edits*.  This should NOT be happening.

I'm also a bit suspicious of WikiPage.clone(), which isn't cloning  
attributes or acls.  This could have some side effects somewhere.   
I'll be testing that...

/Janne

Re: weird access rights issue, was: Re: security configuration question

Posted by Florian Holeczek <fl...@holeczek.de>.
Hallo Janne,

> For example, on those sites that I run, JSPWIKI-27 appears only
> after a few hours. But it never appears on jspwiki.org, even though
> they run exactly the same codebase.

have you already checked if the configuration difference(s) give any
hint?

> 2) Multithreading.  If there are any cases where synchronization is a
> problem, it could pop up here.  All of our tests are single-thread
> only.  This means that it would appear more often under load.
> My guess is that this particular Heisenbug is either of these, and it
> relates to caching somehow.

Well, at least this bug appears even with only one user.
I know nothing about how the page content is processed, but my idea is
that the bug is caused by this data somehow (which is why I've been
referring to the ghost in the code, not the heisenbug... I've been
thinking of this one before, too). Maybe in conjunction with
page ACLs. I'll check if removing the core pages "heals" the wiki
again and if so, I'll try to determine which part of the core pages
causes the effect.

> Florian, does setting the cache size to 1 help (don't turn it off,
> just set the size to 1.)?

I'll check this and report.

Florian


Re: weird access rights issue, was: Re: security configuration question

Posted by Janne Jalkanen <Ja...@ecyrd.com>.
On 19 Aug 2008, at 15:29, Andrew Jaquith wrote:

> I really don't know what to say about this. We have lots and lots  
> of unit tests for ACLs, and many web unit tests that test things  
> from the browser.
>
> All of these tests work fine.
>
> Unless we can devise some tests that allow reproduction of the  
> issue, every time, it's going to be hard for me to help.

One can poke around and hope...

There are a couple of things which our unit tests do *not* test for:

1) Longevity.  A long-running JSPWiki instance which is tested  
against a known set of pages.  Webtests almost do this, but they  
don't do it repeatedly.  This should find caching issues.  For  
example, on those sites that I run, JSPWIKI-27 appears only after a  
few hours.  But it never appears on jspwiki.org, even though they run  
exactly the same codebase.
2) Multithreading.  If there are any cases where synchronization is a  
problem, it could pop up here.  All of our tests are single-thread  
only.  This means that it would appear more often under load.

My guess is that this particular Heisenbug is either of these, and it  
relates to caching somehow.  Florian, does setting the cache size to  
1 help (don't turn it off, just set the size to 1.)?

/Janne

Re: weird access rights issue, was: Re: security configuration question

Posted by Andrew Jaquith <an...@me.com>.
I really don't know what to say about this. We have lots and lots of  
unit tests for ACLs, and many web unit tests that test things from the  
browser.

All of these tests work fine.

Unless we can devise some tests that allow reproduction of the issue,  
every time, it's going to be hard for me to help.

Florian, I do not doubt that you are having

On Aug 19, 2008, at 8:14 AM, Florian Holeczek <fl...@holeczek.de>  
wrote:

> Interesting... in my case, the affected pages are viewable, but
> nothing more. Also, administrators do have full access to it like they
> should.
>
> I have some "allow view all" page ACLs in the pages. Could you check
> for page ACLs maybe in a backup from the time when you had the
> problem? Maybe the ACLs shift somehow in memory.
>
> This brought me to the idea of testing it without the page cache.
> This is spooky...
> Without cache, the error appears in another way.
> * Pages appear with their correct ACLs. They were editable, but: The
>  changes aren't saved!
> * However, no error appears, JSPWiki is behaving as if the save action
>  has been handled correctly.
> * Adding comments to these pages works, but the comment itself isn't
>  written into the page, only the signature.
>
> Like Janne assumed, this could in fact be related to JSPWIKI-27.
> However, the problem described there isn't that dramatic, but the
> "full error" I'm describing here is pretty severe, I think.
>
> I'm experiencing the problem with the current head of trunk (alpha-21
> at the moment).
>
> Andrew, what do you think about it? AFAIK you're the AAA expert in
> here.
>
> Regards
> Florian
>
> Ursprüngliche Nachricht vom 19.08.2008 um 10:18:
>> Florian,
>
>> I think we had similar problems in the past (unfortunately my long  
>> term
>> memory is bad).
>> The symptoms were that (mostly) the main page was not publicly  
>> accessible
>> anymore, only for administrators.
>> Looking at the source of the page, there were no ACL's on it.
>> The workaround for this was always Edit the page (add something to  
>> it) and
>> save it.
>> This problem occurred on average 3 times a week.
>
>> The problem was solved after an upgrade, but I don't know anymore  
>> to which
>> version (you can see the version history on my personal page on  
>> jspwiki.org
>> ).
>
>> We currently run 2.7.0-svn-44, and we don't have the problem anymore.
>
>> Hope this helps,
>> Harry
>

Re: weird access rights issue, was: Re: security configuration question

Posted by Florian Holeczek <fl...@holeczek.de>.
Interesting... in my case, the affected pages are viewable, but
nothing more. Also, administrators do have full access to it like they
should.

I have some "allow view all" page ACLs in the pages. Could you check
for page ACLs maybe in a backup from the time when you had the
problem? Maybe the ACLs shift somehow in memory.

This brought me to the idea of testing it without the page cache.
This is spooky...
Without cache, the error appears in another way.
* Pages appear with their correct ACLs. They were editable, but: The
  changes aren't saved!
* However, no error appears, JSPWiki is behaving as if the save action
  has been handled correctly.
* Adding comments to these pages works, but the comment itself isn't
  written into the page, only the signature.

Like Janne assumed, this could in fact be related to JSPWIKI-27.
However, the problem described there isn't that dramatic, but the
"full error" I'm describing here is pretty severe, I think.

I'm experiencing the problem with the current head of trunk (alpha-21
at the moment).

Andrew, what do you think about it? AFAIK you're the AAA expert in
here.

Regards
 Florian

Ursprüngliche Nachricht vom 19.08.2008 um 10:18:
> Florian,

> I think we had similar problems in the past (unfortunately my long term
> memory is bad).
> The symptoms were that (mostly) the main page was not publicly accessible
> anymore, only for administrators.
> Looking at the source of the page, there were no ACL's on it.
> The workaround for this was always Edit the page (add something to it) and
> save it.
> This problem occurred on average 3 times a week.

> The problem was solved after an upgrade, but I don't know anymore to which
> version (you can see the version history on my personal page on jspwiki.org
> ).

> We currently run 2.7.0-svn-44, and we don't have the problem anymore.

> Hope this helps,
> Harry


Re: weird access rights issue, was: Re: security configuration question

Posted by Harry Metske <ha...@gmail.com>.
Florian,

I think we had similar problems in the past (unfortunately my long term
memory is bad).
The symptoms were that (mostly) the main page was not publicly accessible
anymore, only for administrators.
Looking at the source of the page, there were no ACL's on it.
The workaround for this was always Edit the page (add something to it) and
save it.
This problem occurred on average 3 times a week.

The problem was solved after an upgrade, but I don't know anymore to which
version (you can see the version history on my personal page on jspwiki.org
).

We currently run 2.7.0-svn-44, and we don't have the problem anymore.

Hope this helps,
Harry

2008/8/19 Florian Holeczek <fl...@holeczek.de>

> Hi all,
>
> I think I can at least reproduce this problem now, but still don't
> know what exactly is causing it.
>
> The cause seems to be in the german core pages. I've used them on
> Glassfish 2ur2 on a Solaris Nevada machine as well as on my local
> Tomcat 6 (Windows XP machine).
> So it's at least container-independent.
> It's also not depending on the security policy - appeared with both my
> restrictive policy as well as the standard jspwiki.policy.
>
> The problem appears quite often on the Main page (not editable
> although it should be). If not, try adding a comment to the SandBox.
> At first, edit and comment are available, but when posting the
> comment, in most cases the error "you are not allowed to do
> that" appears. After this, the SandBox isn't editable anymore.
>
> Could someone else try to reproduce it, too? The only thing you have
> to do is using the german core pages from the trunk. It even doesn't
> matter if there are additional pages in the page directory.
>
> Regards
>  Florian
>
> Ursprüngliche Nachricht vom 17.08.2008 um 23:01:
>
> > You need to make a test comment, then a few edits without comments.
> > Check if the comment appears in recentchanges even though it should not.
>
> > Also, do you have access limitations in LeftMenu or any of the other
> > included pages?
>
> > /Janne
>
> > On 17 Aug 2008, at 23:54, Florian Holeczek wrote:
>
> >> I can hardly test this, because the wiki isn't in use (yet).
> >> Tried to do a test comment, but at least this time JSPWIKI-27 didn't
> >> occur.
> >>
> >> Just opened all pages. The error occured on about 5 of the core pages
> >> this time (which are about 30).
> >> Once the error occurs, it's always the same: I have no rights but to
> >> view the page.
> >>
> >> Regards
> >>  Florian
> >>
> >> Ursprüngliche Nachricht vom 17.08.2008 um 22:23:
> >>
> >>> Are you experiencing also the symptoms of JSPWIKI-27?  It could be
> >>> the same cause - but I don't really, really, really know what is
> >>> going on.  I've been trying to fix this since 2.2.x or something...
> >>
> >>> /Janne
> >>
> >>> On 17 Aug 2008, at 23:07, Florian Holeczek wrote:
> >>
> >>>> Hi all,
> >>>>
> >>>> I've got some more details in this problem. Seems as if the access
> >>>> rights toggle randomly across time and pages!
> >>>>
> >>>> Anybody else experienced this before or knows how to detect what's
> >>>> wrong?
> >>>>
> >>>> Should I create a JIRA entry on it?
> >>>>
> >>>> Regards
> >>>>  Florian
> >>>>
> >>>> Ursprüngliche Nachricht vom 17.08.2008 um 14:02:
> >>>>> Here are the log files when trying to edit Main:
> >>>>
> >>>>>> 2008-08-17 14:01:51,464 [httpSSLWorkerThread-8080-1] DEBUG
> >>>>>> com.ecyrd.jspwiki.auth.AuthorizationManager BNV-GZ Wiki:/Edit.jsp
> >>>>>> BNV-GZ Wiki:http://wiki.bnv-gz.de:8080/Edit.jsp - Checking for
> >>>>>> principal: [Ljava.security.Principal;@78b6b3
> >>>>>> 2008-08-17 14:01:51,464 [httpSSLWorkerThread-8080-1] DEBUG
> >>>>>> com.ecyrd.jspwiki.auth.AuthorizationManager BNV-GZ Wiki:/Edit.jsp
> >>>>>> BNV-GZ Wiki:http://wiki.bnv-gz.de:8080/Edit.jsp - Permission:
> >>>>>> ("com.ecyrd.jspwiki.auth.permissions.PagePermission","BNV-GZ
> >>>>>> Wiki:Main","edit")
> >>>>>> 2008-08-17 14:01:51,464 [httpSSLWorkerThread-8080-1] INFO
> >>>>>> com.ecyrd.jspwiki.WikiContext BNV-GZ Wiki:/Edit.jsp BNV-GZ
> >>>>>> Wiki:http://wiki.bnv-gz.de:8080/Edit.jsp - User Florian
> >>>>>> Holeczek has
> >>>>>> no access - forbidden
> >>>>>> (permission=
> >>>>>> ("com.ecyrd.jspwiki.auth.permissions.PagePermission","BNV-GZ
> >>>>>> Wiki:Main","edit"))
> >>>>
> >>>>>  Florian
> >>>>
> >>
>
>


-- 
met vriendelijke groet,
Harry Metske
Telnr. +31-548-512395
Mobile +31-6-51898081

Re: weird access rights issue, was: Re: security configuration question

Posted by Florian Holeczek <fl...@holeczek.de>.
I've just seen that the glassfish server log is filled with amounts of
security related stuff. I have no idea which parts of it are relevant,
so I've deleted the file and did the following:
* Opened the wiki start page, got redirected to login
* Did successful login, got Main page displayed (which contains the
  error at this time!)
* Opened the About page via LeftMenu - got the edit link correctly
  displayed
However, the result file is about 140 K. Where can I provide it?
Does it make sense to provide it?

> You need to make a test comment, then a few edits without comments.
> Check if the comment appears in recentchanges even though it should
> not.

Just wanted to do this, therefore clicked on comment... everything
fine. I filled out the form and wanted to submit it - got an error
page: you're not allowed to do that, better luck next time.
Opening the same page again - no edit link any more.

> Also, do you have access limitations in LeftMenu or any of the other
> included pages?

I only have the german core pages loaded, they contain some "allow
view all" ACLs on some error pages.

Regards
 Florian

Re: weird access rights issue, was: Re: security configuration question

Posted by Florian Holeczek <fl...@holeczek.de>.
> You need to make a test comment, then a few edits without comments.
> Check if the comment appears in recentchanges even though it should not.

Tested again, now the comment doesn't appear anywhere... No matter
which comment (to the comment) I enter, always the standard "Comment
by Florian Holeczek" gets displayed in the version history as well as
the RecentChanges.

Florian

Re: weird access rights issue, was: Re: security configuration question

Posted by Florian Holeczek <fl...@holeczek.de>.
Hi all,

I think I can at least reproduce this problem now, but still don't
know what exactly is causing it.

The cause seems to be in the german core pages. I've used them on
Glassfish 2ur2 on a Solaris Nevada machine as well as on my local
Tomcat 6 (Windows XP machine).
So it's at least container-independent.
It's also not depending on the security policy - appeared with both my
restrictive policy as well as the standard jspwiki.policy.

The problem appears quite often on the Main page (not editable
although it should be). If not, try adding a comment to the SandBox.
At first, edit and comment are available, but when posting the
comment, in most cases the error "you are not allowed to do
that" appears. After this, the SandBox isn't editable anymore.

Could someone else try to reproduce it, too? The only thing you have
to do is using the german core pages from the trunk. It even doesn't
matter if there are additional pages in the page directory.

Regards
 Florian

Ursprüngliche Nachricht vom 17.08.2008 um 23:01:

> You need to make a test comment, then a few edits without comments.   
> Check if the comment appears in recentchanges even though it should not.

> Also, do you have access limitations in LeftMenu or any of the other  
> included pages?

> /Janne

> On 17 Aug 2008, at 23:54, Florian Holeczek wrote:

>> I can hardly test this, because the wiki isn't in use (yet).
>> Tried to do a test comment, but at least this time JSPWIKI-27 didn't
>> occur.
>>
>> Just opened all pages. The error occured on about 5 of the core pages
>> this time (which are about 30).
>> Once the error occurs, it's always the same: I have no rights but to
>> view the page.
>>
>> Regards
>>  Florian
>>
>> Ursprüngliche Nachricht vom 17.08.2008 um 22:23:
>>
>>> Are you experiencing also the symptoms of JSPWIKI-27?  It could be
>>> the same cause - but I don't really, really, really know what is
>>> going on.  I've been trying to fix this since 2.2.x or something...
>>
>>> /Janne
>>
>>> On 17 Aug 2008, at 23:07, Florian Holeczek wrote:
>>
>>>> Hi all,
>>>>
>>>> I've got some more details in this problem. Seems as if the access
>>>> rights toggle randomly across time and pages!
>>>>
>>>> Anybody else experienced this before or knows how to detect what's
>>>> wrong?
>>>>
>>>> Should I create a JIRA entry on it?
>>>>
>>>> Regards
>>>>  Florian
>>>>
>>>> Ursprüngliche Nachricht vom 17.08.2008 um 14:02:
>>>>> Here are the log files when trying to edit Main:
>>>>
>>>>>> 2008-08-17 14:01:51,464 [httpSSLWorkerThread-8080-1] DEBUG
>>>>>> com.ecyrd.jspwiki.auth.AuthorizationManager BNV-GZ Wiki:/Edit.jsp
>>>>>> BNV-GZ Wiki:http://wiki.bnv-gz.de:8080/Edit.jsp - Checking for
>>>>>> principal: [Ljava.security.Principal;@78b6b3
>>>>>> 2008-08-17 14:01:51,464 [httpSSLWorkerThread-8080-1] DEBUG
>>>>>> com.ecyrd.jspwiki.auth.AuthorizationManager BNV-GZ Wiki:/Edit.jsp
>>>>>> BNV-GZ Wiki:http://wiki.bnv-gz.de:8080/Edit.jsp - Permission:
>>>>>> ("com.ecyrd.jspwiki.auth.permissions.PagePermission","BNV-GZ
>>>>>> Wiki:Main","edit")
>>>>>> 2008-08-17 14:01:51,464 [httpSSLWorkerThread-8080-1] INFO
>>>>>> com.ecyrd.jspwiki.WikiContext BNV-GZ Wiki:/Edit.jsp BNV-GZ
>>>>>> Wiki:http://wiki.bnv-gz.de:8080/Edit.jsp - User Florian  
>>>>>> Holeczek has
>>>>>> no access - forbidden
>>>>>> (permission=
>>>>>> ("com.ecyrd.jspwiki.auth.permissions.PagePermission","BNV-GZ
>>>>>> Wiki:Main","edit"))
>>>>
>>>>>  Florian
>>>>
>>


Re: weird access rights issue, was: Re: security configuration question

Posted by Janne Jalkanen <Ja...@ecyrd.com>.
You need to make a test comment, then a few edits without comments.   
Check if the comment appears in recentchanges even though it should not.

Also, do you have access limitations in LeftMenu or any of the other  
included pages?

/Janne

On 17 Aug 2008, at 23:54, Florian Holeczek wrote:

> I can hardly test this, because the wiki isn't in use (yet).
> Tried to do a test comment, but at least this time JSPWIKI-27 didn't
> occur.
>
> Just opened all pages. The error occured on about 5 of the core pages
> this time (which are about 30).
> Once the error occurs, it's always the same: I have no rights but to
> view the page.
>
> Regards
>  Florian
>
> Ursprüngliche Nachricht vom 17.08.2008 um 22:23:
>
>> Are you experiencing also the symptoms of JSPWIKI-27?  It could be
>> the same cause - but I don't really, really, really know what is
>> going on.  I've been trying to fix this since 2.2.x or something...
>
>> /Janne
>
>> On 17 Aug 2008, at 23:07, Florian Holeczek wrote:
>
>>> Hi all,
>>>
>>> I've got some more details in this problem. Seems as if the access
>>> rights toggle randomly across time and pages!
>>>
>>> Anybody else experienced this before or knows how to detect what's
>>> wrong?
>>>
>>> Should I create a JIRA entry on it?
>>>
>>> Regards
>>>  Florian
>>>
>>> Ursprüngliche Nachricht vom 17.08.2008 um 14:02:
>>>> Here are the log files when trying to edit Main:
>>>
>>>>> 2008-08-17 14:01:51,464 [httpSSLWorkerThread-8080-1] DEBUG
>>>>> com.ecyrd.jspwiki.auth.AuthorizationManager BNV-GZ Wiki:/Edit.jsp
>>>>> BNV-GZ Wiki:http://wiki.bnv-gz.de:8080/Edit.jsp - Checking for
>>>>> principal: [Ljava.security.Principal;@78b6b3
>>>>> 2008-08-17 14:01:51,464 [httpSSLWorkerThread-8080-1] DEBUG
>>>>> com.ecyrd.jspwiki.auth.AuthorizationManager BNV-GZ Wiki:/Edit.jsp
>>>>> BNV-GZ Wiki:http://wiki.bnv-gz.de:8080/Edit.jsp - Permission:
>>>>> ("com.ecyrd.jspwiki.auth.permissions.PagePermission","BNV-GZ
>>>>> Wiki:Main","edit")
>>>>> 2008-08-17 14:01:51,464 [httpSSLWorkerThread-8080-1] INFO
>>>>> com.ecyrd.jspwiki.WikiContext BNV-GZ Wiki:/Edit.jsp BNV-GZ
>>>>> Wiki:http://wiki.bnv-gz.de:8080/Edit.jsp - User Florian  
>>>>> Holeczek has
>>>>> no access - forbidden
>>>>> (permission=
>>>>> ("com.ecyrd.jspwiki.auth.permissions.PagePermission","BNV-GZ
>>>>> Wiki:Main","edit"))
>>>
>>>>  Florian
>>>
>


Re: weird access rights issue, was: Re: security configuration question

Posted by Florian Holeczek <fl...@holeczek.de>.
I can hardly test this, because the wiki isn't in use (yet).
Tried to do a test comment, but at least this time JSPWIKI-27 didn't
occur.

Just opened all pages. The error occured on about 5 of the core pages
this time (which are about 30).
Once the error occurs, it's always the same: I have no rights but to
view the page.

Regards
 Florian

Ursprüngliche Nachricht vom 17.08.2008 um 22:23:

> Are you experiencing also the symptoms of JSPWIKI-27?  It could be  
> the same cause - but I don't really, really, really know what is  
> going on.  I've been trying to fix this since 2.2.x or something...

> /Janne

> On 17 Aug 2008, at 23:07, Florian Holeczek wrote:

>> Hi all,
>>
>> I've got some more details in this problem. Seems as if the access
>> rights toggle randomly across time and pages!
>>
>> Anybody else experienced this before or knows how to detect what's
>> wrong?
>>
>> Should I create a JIRA entry on it?
>>
>> Regards
>>  Florian
>>
>> Ursprüngliche Nachricht vom 17.08.2008 um 14:02:
>>> Here are the log files when trying to edit Main:
>>
>>>> 2008-08-17 14:01:51,464 [httpSSLWorkerThread-8080-1] DEBUG
>>>> com.ecyrd.jspwiki.auth.AuthorizationManager BNV-GZ Wiki:/Edit.jsp
>>>> BNV-GZ Wiki:http://wiki.bnv-gz.de:8080/Edit.jsp - Checking for
>>>> principal: [Ljava.security.Principal;@78b6b3
>>>> 2008-08-17 14:01:51,464 [httpSSLWorkerThread-8080-1] DEBUG
>>>> com.ecyrd.jspwiki.auth.AuthorizationManager BNV-GZ Wiki:/Edit.jsp
>>>> BNV-GZ Wiki:http://wiki.bnv-gz.de:8080/Edit.jsp - Permission:
>>>> ("com.ecyrd.jspwiki.auth.permissions.PagePermission","BNV-GZ  
>>>> Wiki:Main","edit")
>>>> 2008-08-17 14:01:51,464 [httpSSLWorkerThread-8080-1] INFO
>>>> com.ecyrd.jspwiki.WikiContext BNV-GZ Wiki:/Edit.jsp BNV-GZ
>>>> Wiki:http://wiki.bnv-gz.de:8080/Edit.jsp - User Florian Holeczek has
>>>> no access - forbidden
>>>> (permission= 
>>>> ("com.ecyrd.jspwiki.auth.permissions.PagePermission","BNV-GZ  
>>>> Wiki:Main","edit"))
>>
>>>  Florian
>>


Re: weird access rights issue, was: Re: security configuration question

Posted by Janne Jalkanen <Ja...@ecyrd.com>.
Are you experiencing also the symptoms of JSPWIKI-27?  It could be  
the same cause - but I don't really, really, really know what is  
going on.  I've been trying to fix this since 2.2.x or something...

/Janne

On 17 Aug 2008, at 23:07, Florian Holeczek wrote:

> Hi all,
>
> I've got some more details in this problem. Seems as if the access
> rights toggle randomly across time and pages!
>
> Anybody else experienced this before or knows how to detect what's
> wrong?
>
> Should I create a JIRA entry on it?
>
> Regards
>  Florian
>
> Ursprüngliche Nachricht vom 17.08.2008 um 14:02:
>> Here are the log files when trying to edit Main:
>
>>> 2008-08-17 14:01:51,464 [httpSSLWorkerThread-8080-1] DEBUG
>>> com.ecyrd.jspwiki.auth.AuthorizationManager BNV-GZ Wiki:/Edit.jsp
>>> BNV-GZ Wiki:http://wiki.bnv-gz.de:8080/Edit.jsp - Checking for
>>> principal: [Ljava.security.Principal;@78b6b3
>>> 2008-08-17 14:01:51,464 [httpSSLWorkerThread-8080-1] DEBUG
>>> com.ecyrd.jspwiki.auth.AuthorizationManager BNV-GZ Wiki:/Edit.jsp
>>> BNV-GZ Wiki:http://wiki.bnv-gz.de:8080/Edit.jsp - Permission:
>>> ("com.ecyrd.jspwiki.auth.permissions.PagePermission","BNV-GZ  
>>> Wiki:Main","edit")
>>> 2008-08-17 14:01:51,464 [httpSSLWorkerThread-8080-1] INFO
>>> com.ecyrd.jspwiki.WikiContext BNV-GZ Wiki:/Edit.jsp BNV-GZ
>>> Wiki:http://wiki.bnv-gz.de:8080/Edit.jsp - User Florian Holeczek has
>>> no access - forbidden
>>> (permission= 
>>> ("com.ecyrd.jspwiki.auth.permissions.PagePermission","BNV-GZ  
>>> Wiki:Main","edit"))
>
>>  Florian
>


Re: weird access rights issue, was: Re: security configuration question

Posted by Janne Jalkanen <Ja...@ecyrd.com>.
Are you experiencing also the symptoms of JSPWIKI-27?  It could be  
the same cause - but I don't really, really, really know what is  
going on.  I've been trying to fix this since 2.2.x or something...

/Janne

On 17 Aug 2008, at 23:07, Florian Holeczek wrote:

> Hi all,
>
> I've got some more details in this problem. Seems as if the access
> rights toggle randomly across time and pages!
>
> Anybody else experienced this before or knows how to detect what's
> wrong?
>
> Should I create a JIRA entry on it?
>
> Regards
>  Florian
>
> Ursprüngliche Nachricht vom 17.08.2008 um 14:02:
>> Here are the log files when trying to edit Main:
>
>>> 2008-08-17 14:01:51,464 [httpSSLWorkerThread-8080-1] DEBUG
>>> com.ecyrd.jspwiki.auth.AuthorizationManager BNV-GZ Wiki:/Edit.jsp
>>> BNV-GZ Wiki:http://wiki.bnv-gz.de:8080/Edit.jsp - Checking for
>>> principal: [Ljava.security.Principal;@78b6b3
>>> 2008-08-17 14:01:51,464 [httpSSLWorkerThread-8080-1] DEBUG
>>> com.ecyrd.jspwiki.auth.AuthorizationManager BNV-GZ Wiki:/Edit.jsp
>>> BNV-GZ Wiki:http://wiki.bnv-gz.de:8080/Edit.jsp - Permission:
>>> ("com.ecyrd.jspwiki.auth.permissions.PagePermission","BNV-GZ  
>>> Wiki:Main","edit")
>>> 2008-08-17 14:01:51,464 [httpSSLWorkerThread-8080-1] INFO
>>> com.ecyrd.jspwiki.WikiContext BNV-GZ Wiki:/Edit.jsp BNV-GZ
>>> Wiki:http://wiki.bnv-gz.de:8080/Edit.jsp - User Florian Holeczek has
>>> no access - forbidden
>>> (permission= 
>>> ("com.ecyrd.jspwiki.auth.permissions.PagePermission","BNV-GZ  
>>> Wiki:Main","edit"))
>
>>  Florian
>


weird access rights issue, was: Re: security configuration question

Posted by Florian Holeczek <fl...@holeczek.de>.
Hi all,

I've got some more details in this problem. Seems as if the access
rights toggle randomly across time and pages!

Anybody else experienced this before or knows how to detect what's
wrong?

Should I create a JIRA entry on it?

Regards
 Florian

Ursprüngliche Nachricht vom 17.08.2008 um 14:02:
> Here are the log files when trying to edit Main:

>> 2008-08-17 14:01:51,464 [httpSSLWorkerThread-8080-1] DEBUG
>> com.ecyrd.jspwiki.auth.AuthorizationManager BNV-GZ Wiki:/Edit.jsp
>> BNV-GZ Wiki:http://wiki.bnv-gz.de:8080/Edit.jsp - Checking for
>> principal: [Ljava.security.Principal;@78b6b3
>> 2008-08-17 14:01:51,464 [httpSSLWorkerThread-8080-1] DEBUG
>> com.ecyrd.jspwiki.auth.AuthorizationManager BNV-GZ Wiki:/Edit.jsp
>> BNV-GZ Wiki:http://wiki.bnv-gz.de:8080/Edit.jsp - Permission:
>> ("com.ecyrd.jspwiki.auth.permissions.PagePermission","BNV-GZ Wiki:Main","edit")
>> 2008-08-17 14:01:51,464 [httpSSLWorkerThread-8080-1] INFO
>> com.ecyrd.jspwiki.WikiContext BNV-GZ Wiki:/Edit.jsp BNV-GZ
>> Wiki:http://wiki.bnv-gz.de:8080/Edit.jsp - User Florian Holeczek has
>> no access - forbidden
>> (permission=("com.ecyrd.jspwiki.auth.permissions.PagePermission","BNV-GZ Wiki:Main","edit"))

>  Florian


weird access rights issue, was: Re: security configuration question

Posted by Florian Holeczek <fl...@holeczek.de>.
Hi all,

I've got some more details in this problem. Seems as if the access
rights toggle randomly across time and pages!

Anybody else experienced this before or knows how to detect what's
wrong?

Should I create a JIRA entry on it?

Regards
 Florian

Ursprüngliche Nachricht vom 17.08.2008 um 14:02:
> Here are the log files when trying to edit Main:

>> 2008-08-17 14:01:51,464 [httpSSLWorkerThread-8080-1] DEBUG
>> com.ecyrd.jspwiki.auth.AuthorizationManager BNV-GZ Wiki:/Edit.jsp
>> BNV-GZ Wiki:http://wiki.bnv-gz.de:8080/Edit.jsp - Checking for
>> principal: [Ljava.security.Principal;@78b6b3
>> 2008-08-17 14:01:51,464 [httpSSLWorkerThread-8080-1] DEBUG
>> com.ecyrd.jspwiki.auth.AuthorizationManager BNV-GZ Wiki:/Edit.jsp
>> BNV-GZ Wiki:http://wiki.bnv-gz.de:8080/Edit.jsp - Permission:
>> ("com.ecyrd.jspwiki.auth.permissions.PagePermission","BNV-GZ Wiki:Main","edit")
>> 2008-08-17 14:01:51,464 [httpSSLWorkerThread-8080-1] INFO
>> com.ecyrd.jspwiki.WikiContext BNV-GZ Wiki:/Edit.jsp BNV-GZ
>> Wiki:http://wiki.bnv-gz.de:8080/Edit.jsp - User Florian Holeczek has
>> no access - forbidden
>> (permission=("com.ecyrd.jspwiki.auth.permissions.PagePermission","BNV-GZ Wiki:Main","edit"))

>  Florian


Re: security configuration question

Posted by Florian Holeczek <fl...@holeczek.de>.
Here are the log files when trying to edit Main:

> 2008-08-17 14:01:51,464 [httpSSLWorkerThread-8080-1] DEBUG
> com.ecyrd.jspwiki.auth.AuthorizationManager BNV-GZ Wiki:/Edit.jsp
> BNV-GZ Wiki:http://wiki.bnv-gz.de:8080/Edit.jsp - Checking for
> principal: [Ljava.security.Principal;@78b6b3
> 2008-08-17 14:01:51,464 [httpSSLWorkerThread-8080-1] DEBUG
> com.ecyrd.jspwiki.auth.AuthorizationManager BNV-GZ Wiki:/Edit.jsp
> BNV-GZ Wiki:http://wiki.bnv-gz.de:8080/Edit.jsp - Permission:
> ("com.ecyrd.jspwiki.auth.permissions.PagePermission","BNV-GZ Wiki:Main","edit")
> 2008-08-17 14:01:51,464 [httpSSLWorkerThread-8080-1] INFO
> com.ecyrd.jspwiki.WikiContext BNV-GZ Wiki:/Edit.jsp BNV-GZ
> Wiki:http://wiki.bnv-gz.de:8080/Edit.jsp - User Florian Holeczek has
> no access - forbidden
> (permission=("com.ecyrd.jspwiki.auth.permissions.PagePermission","BNV-GZ Wiki:Main","edit"))

 Florian


Re: security configuration question

Posted by Florian Holeczek <fl...@holeczek.de>.
> I seem to recall that not too long ago these implied permissions were
> changed somewhat (because they caused too much confusion).  Maybe
> someone else closer to that (Andrew?) could comment.  In the meanwhile,
> just for grins, you might still try explicitly adding 'edit' and see if
> that changes your site's behavior.

Terry, you're right, this has been changed in v2.6. I've updated the
online documentation (it was only mentioned on NewIn2.6, nowhere
else).

It's working now, however not on all pages. LeftMenu and Main are the
only ones which aren't editable and I have no idea why.

Here's my current jspwiki.policy:
---
grant principal com.ecyrd.jspwiki.auth.authorize.Role "All" {
    permission com.ecyrd.jspwiki.auth.permissions.WikiPermission "*", "login";
    permission com.ecyrd.jspwiki.auth.permissions.WikiPermission "*", "editPreferences";
    permission com.ecyrd.jspwiki.auth.permissions.WikiPermission "*", "editProfile";
};

grant principal com.ecyrd.jspwiki.auth.authorize.Role "Anonymous" {
};

grant principal com.ecyrd.jspwiki.auth.authorize.Role "Asserted" {
};

grant principal com.ecyrd.jspwiki.auth.authorize.Role "Authenticated" {
// alles bis auf delete
    permission com.ecyrd.jspwiki.auth.permissions.PagePermission "*:*", "view,edit,modify,comment,rename,upload";

// Gruppen ansehen, aber nur die ändern, in denen man Mitglied ist. Keine löschen.
    permission com.ecyrd.jspwiki.auth.permissions.GroupPermission "*:*", "view";
    permission com.ecyrd.jspwiki.auth.permissions.GroupPermission "*:<groupmember>", "edit";

    permission com.ecyrd.jspwiki.auth.permissions.WikiPermission "*", "createPages,createGroups";
};

grant principal com.ecyrd.jspwiki.auth.GroupPrincipal "Admin" {
    permission com.ecyrd.jspwiki.auth.permissions.AllPermission "*";
};
grant principal com.ecyrd.jspwiki.auth.authorize.Role "Admin" {
    permission com.ecyrd.jspwiki.auth.permissions.AllPermission "*";
};
---

Regards
 Florian


Re: security configuration question

Posted by Terry Steichen <te...@net-frame.com>.
I seem to recall that not too long ago these implied permissions were
changed somewhat (because they caused too much confusion).  Maybe
someone else closer to that (Andrew?) could comment.  In the meanwhile,
just for grins, you might still try explicitly adding 'edit' and see if
that changes your site's behavior.

On Fri, 2008-08-15 at 19:26 +0200, Florian Holeczek wrote:

> Hallo Terry,
> 
> thanks for your reply! According to http://doc.jspwiki.org/2.4/wiki/Security
> > The "rename" PagePermission implies "modify"
> > The "modify" PagePermission implies "edit" and "upload"
> 
> it should work with rename I guess.
> 
> Regards
>  Florian
> 
> Ursprüngliche Nachricht vom 15.08.2008 um 18:42:
> > Don't you need to add a PagePermission=edit?
> 
> >     (permission com.ecyrd.jspwiki.auth.permissions.PagePermission "*:*",
> > "view,rename,edit";)
> 

Re: security configuration question

Posted by Florian Holeczek <fl...@holeczek.de>.
Hallo Terry,

thanks for your reply! According to http://doc.jspwiki.org/2.4/wiki/Security
> The "rename" PagePermission implies "modify"
> The "modify" PagePermission implies "edit" and "upload"

it should work with rename I guess.

Regards
 Florian

Ursprüngliche Nachricht vom 15.08.2008 um 18:42:
> Don't you need to add a PagePermission=edit?

>     (permission com.ecyrd.jspwiki.auth.permissions.PagePermission "*:*",
> "view,rename,edit";)


Re: security configuration question

Posted by Terry Steichen <te...@net-frame.com>.
Don't you need to add a PagePermission=edit?

    (permission com.ecyrd.jspwiki.auth.permissions.PagePermission "*:*",
"view,rename,edit";)




On Fri, 2008-08-15 at 18:20 +0200, Florian Holeczek wrote:

> Hi all,
> 
> I've just set up a public wiki which should only be accessible to
> authenticated users. However, every visitor should be able to sign in.
> He's then approved via the user creation workflow.
> 
> Protecting the wiki content from unauthenticated users works - but
> unfortunately, neither authenticated users nor the administrator can
> edit pages. Either there's no error message at all (meaning the page
> content simply won't be changed) or there's an error message "you're
> not allowed to do that.
> 
> Here's some part of my log:
> 
> > 2008-08-15 18:09:01,596 [httpSSLWorkerThread-8080-1] INFO
> > SecurityLog BNV-GZ Wiki:/Login.jsp BNV-GZ
> > Wiki:http://wiki.bnv-gz.de:8080/Login.jsp -
> > WikiSecurityEvent.LOGIN_AUTHENTICATED
> > [source=com.ecyrd.jspwiki.auth.AuthenticationManager@1af2bc,
> > princpal=com.ecyrd.jspwiki.auth.WikiPrincipal admin,
> > target=com.ecyrd.jspwiki.WikiSession@8f9a4f]
> > 2008-08-15 18:09:01,597 [httpSSLWorkerThread-8080-1] INFO JSPWiki
> > BNV-GZ Wiki:/Login.jsp BNV-GZ
> > Wiki:http://wiki.bnv-gz.de:8080/Login.jsp - Successfully
> > authenticated user admin (custom auth)
> > 2008-08-15 18:09:01,599 [httpSSLWorkerThread-8080-1] INFO JSPWiki
> > BNV-GZ Wiki:/Login.jsp BNV-GZ
> > Wiki:http://wiki.bnv-gz.de:8080/Login.jsp - Redirecting user to
> > http://wiki.bnv-gz.de:8080/wiki/Main
> > 2008-08-15 18:09:01,678 [httpSSLWorkerThread-8080-0] INFO
> > com.ecyrd.jspwiki.WikiServlet BNV-GZ Wiki:/wiki/Main BNV-GZ
> > Wiki:http://wiki.bnv-gz.de:8080/wiki/Main - Request for page: Main
> > 2008-08-15 18:09:06,810 [httpSSLWorkerThread-8080-1] INFO
> > com.ecyrd.jspwiki.WikiServlet BNV-GZ Wiki:/wiki/SandBox BNV-GZ
> > Wiki:http://wiki.bnv-gz.de:8080/wiki/SandBox - Request for page: SandBox
> > 2008-08-15 18:09:08,807 [httpSSLWorkerThread-8080-0] INFO JSPWiki
> > BNV-GZ Wiki:/Edit.jsp BNV-GZ
> > Wiki:http://wiki.bnv-gz.de:8080/Edit.jsp - Editing page SandBox.
> > User=Administrator, host=91.47.176.42
> > 2008-08-15 18:09:24,462 [httpSSLWorkerThread-8080-0] INFO JSPWiki
> > BNV-GZ Wiki:/Edit.jsp BNV-GZ
> > Wiki:http://wiki.bnv-gz.de:8080/Edit.jsp - Saving page SandBox.
> > User=Administrator, host=91.47.176.42
> > 2008-08-15 18:09:24,545 [httpSSLWorkerThread-8080-1] INFO
> > com.ecyrd.jspwiki.WikiServlet BNV-GZ Wiki:/wiki/SandBox BNV-GZ
> > Wiki:http://wiki.bnv-gz.de:8080/wiki/SandBox - Request for page: SandBox
> 
> This is my jspwiki.policy:
> ---
> grant principal com.ecyrd.jspwiki.auth.authorize.Role "All" {
>     permission com.ecyrd.jspwiki.auth.permissions.WikiPermission "*", "editPreferences";
>     permission com.ecyrd.jspwiki.auth.permissions.WikiPermission "*", "editProfile";
>     permission com.ecyrd.jspwiki.auth.permissions.WikiPermission "*", "login";
> };
> 
> grant principal com.ecyrd.jspwiki.auth.authorize.Role "Anonymous" {
> };
> 
> grant principal com.ecyrd.jspwiki.auth.authorize.Role "Asserted" {
> };
> 
> grant principal com.ecyrd.jspwiki.auth.authorize.Role "Authenticated" {
>     permission com.ecyrd.jspwiki.auth.permissions.PagePermission "*:*", "view,rename";
>     permission com.ecyrd.jspwiki.auth.permissions.GroupPermission "*:*", "view";
>     permission com.ecyrd.jspwiki.auth.permissions.GroupPermission "*:<groupmember>", "edit";
>     permission com.ecyrd.jspwiki.auth.permissions.WikiPermission "*", "createPages,createGroups";
> };
> 
> grant principal com.ecyrd.jspwiki.auth.GroupPrincipal "Admin" {
>     permission com.ecyrd.jspwiki.auth.permissions.AllPermission "*";
> };
> grant principal com.ecyrd.jspwiki.auth.authorize.Role "Admin" {
>     permission com.ecyrd.jspwiki.auth.permissions.AllPermission "*";
> };
> ---
> 
> What am I doing wrong?
> Thanks in advance!
> 
> Best Regards
>  Florian