| View previous topic :: View next topic |
| Author |
Message |
rantaaho
Joined: 09 Jan 2008 Posts: 47 Location: Kuopio, Finland
|
Posted: Mon 19 May, 2008 14:04 Post subject: Page retrieval |
|
|
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 |
|
 |
jens Administrator
Joined: 12 Oct 2005 Posts: 972 Location: duisburg, germany
|
|
| Back to top |
|
 |
jens Administrator
Joined: 12 Oct 2005 Posts: 972 Location: duisburg, germany
|
Posted: Mon 19 May, 2008 21:26 Post subject: |
|
|
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 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 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 |
|
 |
rantaaho
Joined: 09 Jan 2008 Posts: 47 Location: Kuopio, Finland
|
Posted: Tue 20 May, 2008 08:26 Post subject: |
|
|
| 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 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 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 |
|
 |
jens Administrator
Joined: 12 Oct 2005 Posts: 972 Location: duisburg, germany
|
Posted: Tue 20 May, 2008 09:47 Post subject: |
|
|
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 |
|
 |
rantaaho
Joined: 09 Jan 2008 Posts: 47 Location: Kuopio, Finland
|
|
| Back to top |
|
 |
jens Administrator
Joined: 12 Oct 2005 Posts: 972 Location: duisburg, germany
|
|
| Back to top |
|
 |
|
|
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
|
|