FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Page retrieval

 
Post new topic   Reply to topic    PyLucid - CMS - Forum Forum Index -> system
View previous topic :: View next topic  
Author Message
rantaaho



Joined: 09 Jan 2008
Posts: 47
Location: Kuopio, Finland

PostPosted: Mon 19 May, 2008 14:04    Post subject: Page retrieval Reply with quote

I was preparing to dive into page permissions when noticed this: with standard unit test page hierarchy request for (non existent) page '/1_AAA/2_1_EEE/' does not result an 404 but instead page '/2_DDD/2_1_EEE/' is served. I added small unit test for this [url=
http://trac.pylucid.net/browser/trunk/pylucid/tests/page_fetching.py?rev=1578]1578[/url]

I thought that this must be a bug, but is it?
Back to top
View user's profile Send private message
jens
Administrator


Joined: 12 Oct 2005
Posts: 972
Location: duisburg, germany

PostPosted: Mon 19 May, 2008 14:40    Post subject: Reply with quote

Great to see new commits from you Wink

This behavior is normal Wink
PyLucid used only the last existing shortcut. That is intended, because of: http://pylucid.org/_goto/125/internal-links/#via-shortcut-not-recommended
OK, now we have permalink and the shortcut links are not recommended, but it still works.

There still exist a old ticket: http://trac.pylucid.net/ticket/37 It's about how to insert internal page links. The easiest way is to use the page shortcut and not a permalink...

But i don't know if we should change all of the link stuff...

How it currently work:

This is the complete link: http://pylucid.org/about/features/unicode-test/DecodeUnicode

These "wrong" links works, too:
http://pylucid.org/about/features/DecodeUnicode
http://pylucid.org/about/DecodeUnicode
http://pylucid.org/DecodeUnicode

this also:
http://pylucid.org/some/not/existing/stuff/DecodeUnicode

Here we get a Redirect to the right page:
http://pylucid.org/DecodeUnicode/some/other/stuff/
_________________

http://www.jensdiemer.de | http://www.htfx.de | http://www.python-forum.de
Back to top
View user's profile Send private message
jens
Administrator


Joined: 12 Oct 2005
Posts: 972
Location: duisburg, germany

PostPosted: Mon 19 May, 2008 21:26    Post subject: Reply with quote

I'm thinking about http://trac.pylucid.net/changeset/1577
I don't think this is the best solution. The bad thing: every page request must check all parent pages recursively. Thats bat for performance Wink Don't know if we can create some cache around this.

Other solution: If a user change permitViewPublic, we add it recusively to all child pages, with the rule: Deny comes forwards permits:

    * If as user set permitViewPublic to False, all child pages set to False, too.
    * If the user set permitViewPublic to True, only the current page changes.


But thants not really good, isn't it. It not easy to handle many pages Sad We must add a plugin to give the Admin a simple workflow...
_________________

http://www.jensdiemer.de | http://www.htfx.de | http://www.python-forum.de
Back to top
View user's profile Send private message
rantaaho



Joined: 09 Jan 2008
Posts: 47
Location: Kuopio, Finland

PostPosted: Tue 20 May, 2008 08:26    Post subject: Reply with quote

jens wrote:
I'm thinking about http://trac.pylucid.net/changeset/1577
I don't think this is the best solution. The bad thing: every page request must check all parent pages recursively. Thats bat for performance Wink Don't know if we can create some cache around this.


Yes, I was aware of performance hit. The fixed bug was situation when page:
http://example.com/Parent/Child
exists but Parent has restricted access. Due to loose url syntax:
http://example.com/Child
gave errors to unauthorized user, since before http://trac.pylucid.net/changeset/1577 permission problem was not noticed and PyLucid tried to serve page. Errors came from mainmenu (or some other plugin) when it tried to get information about Parent without success.

I think that your solution:

jens wrote:

Other solution: If a user change permitViewPublic, we add it recusively to all child pages, with the rule: Deny comes forwards permits:

    * If as user set permitViewPublic to False, all child pages set to False, too.
    * If the user set permitViewPublic to True, only the current page changes.



With addition: New child inherits parents permissions. Is actually quite ok. Even though, we still need recursive checking, just to be sure, it will just boil out faster.

I'm biased with my planned use case: I need several "intranets" i.e. access to certain page hierarchy is permitted only to some group of users. And in optimal case admin will create new "parent" with suitable permissions and then users can add/modify pages and permission will just work. I'm afraid that loose url syntax will cause me some headache, but that's other problem...

jens wrote:

But thants not really good, isn't it. It not easy to handle many pages Sad We must add a plugin to give the Admin a simple workflow...


Hmm, yes with lot's of changes one can create a big mess. But that's a kind of property of the permissions. Maybe some tree like presentation could be helpful for Admin.
Back to top
View user's profile Send private message
jens
Administrator


Joined: 12 Oct 2005
Posts: 972
Location: duisburg, germany

PostPosted: Tue 20 May, 2008 09:47    Post subject: Reply with quote

btw. i added "How to build urls/permalink?" section in our brain storming page here:
http://trac.pylucid.net/wiki/MultiLanguagePages#Howtobuildurlspermalink

We should not change the "detect page" mechanism now. We can think about it later, when we implement the Multi-language-page stuff...

About the current "detect page" mechanism, i write a new page: http://www.pylucid.org/_goto/158/detect-page/


rantaaho wrote:
Yes, I was aware of performance hit.
...
I think that your solution:

jens wrote:

Other solution: If a user change permitViewPublic, we add it recusively to all child pages, with the rule: Deny comes forwards permits:

    * If as user set permitViewPublic to False, all child pages set to False, too.
    * If the user set permitViewPublic to True, only the current page changes.



With addition: New child inherits parents permissions. Is actually quite ok. Even though, we still need recursive checking, just to be sure, it will just boil out faster.


We should should worry about this performance hit, now and leave the other problematic for v0.9

btw. the page_admin passes the parent permissions to a new page:
http://trac.pylucid.net/browser/trunk/pylucid/PyLucid/plugins_internal/page_admin/page_admin.py?rev=1578#L329
I have created a new docu page about this: http://www.pylucid.org/_goto/155/create-new-page/
_________________

http://www.jensdiemer.de | http://www.htfx.de | http://www.python-forum.de
Back to top
View user's profile Send private message
rantaaho



Joined: 09 Jan 2008
Posts: 47
Location: Kuopio, Finland

PostPosted: Tue 20 May, 2008 10:24    Post subject: Reply with quote

I noticed your documentation updates after I had updated http://www.pylucid.org/Contribute/developer-documentation/render-workflow/
Page detection is there too.

I'm not sure about the level of details in that text, but I wanted to write it down for my self. And anyway its under developer-documentation...
Back to top
View user's profile Send private message
jens
Administrator


Joined: 12 Oct 2005
Posts: 972
Location: duisburg, germany

PostPosted: Tue 20 May, 2008 10:31    Post subject: Reply with quote

Oh, we need an how is online and a logging function Wink

We have information for users and for developer, that's good...
_________________

http://www.jensdiemer.de | http://www.htfx.de | http://www.python-forum.de
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PyLucid - CMS - Forum Forum Index -> system All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

<< back to PyLucid CMS Homepage



Powered by phpBB © 2001, 2005 phpBB Group