Skip to content

Commit 2f6edf7

Browse files
author
Richard Jones
committed
more docco... and we need to check for web access Permission!
1 parent 311f6a1 commit 2f6edf7

File tree

4 files changed

+89
-4
lines changed

4 files changed

+89
-4
lines changed

TODO.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,15 @@ pending web: search "refinement"
4747
query values
4848
pending web: have roundup.cgi pick up instance config from the environment
4949
pending web: UNIX init.d script for roundup-server
50-
pending web: rewritten documentation (can come after the beta though so stuff
51-
is settled)
5250
pending web: modify cgitb to handle PageTemplate errors better (see how
5351
Zope handles __traceback_supplement__ and __traceback_info__)
5452
pending web: title is stoopid
53+
pending web: rewritten documentation (can come after the beta though so stuff
54+
is settled) ... including relevant file names in customisation doc
5555

5656
bug: request.url is incorrect in cgi-bin environments
5757

58+
5859
done web: Re-enable link backrefs from messages (feature request #568714) (RJ)
5960
done web: have the page layout (header/footer) be templatable (RJ)
6061
done web: fixing the templating so it works (RJ)

doc/customizing.txt

Lines changed: 81 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Customising Roundup
33
===================
44

5-
:Version: $Revision: 1.17 $
5+
:Version: $Revision: 1.18 $
66

77
.. contents::
88

@@ -675,6 +675,86 @@ which defaults to:
675675
- only classname suplied: "index"
676676
- full item designator supplied: "item"
677677

678+
Actions are triggered by using a ``:action`` CGI variable, where the value is
679+
one of:
680+
681+
login
682+
Attempt to log a user in.
683+
logout
684+
Log the user out - make them "anonymous".
685+
register
686+
Attempt to create a new user based on the contents of the form and then log
687+
them in.
688+
edit
689+
Perform an edit of an item in the database. There are some special form
690+
elements you may use:
691+
692+
:link=designator:property and :multilink=designator:property
693+
The value specifies a node designator and the property on that
694+
node to add _this_ node to as a link or multilink.
695+
__note
696+
Create a message and attach it to the current node's
697+
"messages" property.
698+
__file
699+
Create a file and attach it to the current node's
700+
"files" property. Attach the file to the message created from
701+
the __note if it's supplied.
702+
:required=property,property,...
703+
The named properties are required to be filled in the form.
704+
705+
new
706+
Add a new item to the database. You may use the same special form elements
707+
as in the "edit" action.
708+
709+
editCSV
710+
Performs an edit of all of a class' items in one go. See also the
711+
*class*.csv templating method which generates the CSV data to be edited, and
712+
the "_generic.index" template which uses both of these features.
713+
714+
search
715+
Mangle some of the form variables.
716+
717+
Set the form ":filter" variable based on the values of the
718+
filter variables - if they're set to anything other than
719+
"dontcare" then add them to :filter.
720+
721+
Also handle the ":queryname" variable and save off the query to
722+
the user's query list.
723+
724+
Each of the actions is implemented by a corresponding *name*Action method on
725+
the roundup.cgi.Client class, which also happens to be in your instance as
726+
interfaces.Client. So if you need to define new actions, you may add them
727+
there (see `definining new web actions`_).
728+
729+
Each action also has a corresponding *name*Permission method which determines
730+
whether the action is permissible given the current user. The base permission
731+
checks are:
732+
733+
login
734+
XXX TODO
735+
logout
736+
No permission checks are made.
737+
register
738+
Determine whether the user has permission to register
739+
Base behaviour is to check the user has "Web Registration".
740+
edit
741+
Determine whether the user has permission to edit this item.
742+
Base behaviour is to check the user can edit this class. If we're
743+
editing the "user" class, users are allowed to edit their own
744+
details. Unless it's the "roles" property, which requires the
745+
special Permission "Web Roles".
746+
new
747+
Determine whether the user has permission to create (edit) this item.
748+
Base behaviour is to check the user can edit this class. No
749+
additional property checks are made. Additionally, new user items
750+
may be created if the user has the "Web Registration" Permission.
751+
editCSV
752+
Determine whether the user has permission to edit this class.
753+
Base behaviour is to check the user can edit this class.
754+
search
755+
Determine whether the user has permission to search this class.
756+
Base behaviour is to check the user can view this class.
757+
678758

679759
Repurcussions of changing the instance schema
680760
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

roundup/cgi/client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: client.py,v 1.16 2002-09-05 23:48:55 richard Exp $
1+
# $Id: client.py,v 1.17 2002-09-06 03:21:30 richard Exp $
22

33
__doc__ = """
44
WWW request handler (also used in the stand-alone server).
@@ -496,6 +496,8 @@ def login_action(self):
496496
self.error_message.append(_('Incorrect password'))
497497
return
498498

499+
# XXX check for web access permission!!!!
500+
499501
# set the session cookie
500502
self.set_cookie(self.user, password)
501503

roundup/templates/classic/html/user.item

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ You are not allowed to view this page.
1111
<tal:block tal:condition="editok">
1212
<form method="POST" onSubmit="return submit_once()" enctype="multipart/form-data">
1313

14+
<input type="hidden" name=":required" value="username,address">
15+
1416
<table class="form">
1517
<tr>
1618
<th>Name</th>

0 commit comments

Comments
 (0)