Hi Stef,
sorry that I could not replay the last days, I have too much other
things to do right now. Yesterday night I started trying to fix some of
the bugs and suggestions made during that week, but I could not finish
yet.
Also I have problems reproducing the Swazoo bug, as I cannot download
the whole package from Cincom into a new image. After about 10 or 20
minutes I get a timeout before it has been loaded completely. When
updating to the latest version of Swazoo in my development image, no
bug occurs; but the updating doesn't seem to work as I don't have a
class called HTTPPostDataArray and the message #keysAndValuesDo: works
properly.
Anyway, if I understand correctly there are
permissions and users.
Permission are grants to perform action.
A role contains a list of permissions.
A user play certain roles.
The class diagram looks like this:
SecurityInformation
A
|
+-----------------------+--------------------------+
| | |
| | |
User (1) -------> (1..) Role (1) -------> (1..) Permission
Users are defined in the server class. Existing roles are just the
union of all roles assigned to all the users in the system. The
comparison #= of Roles and Permission is done using their name.
When processing a query, e.g. /a/b?action=MyAction, the following
actions are taken:
- The server is looking for a username and password given in the
request header. The username is looked-up in the server and checked if
the password matches, if so a copy of that user is assigned to the
current request. If there is no authentication given or if the
authentication does not match, the anonymous-user is assigned
automatically.
- As you know, the chain-of-responsibilities is started and the request
is passed to the root structure. Every structure has the possibility to
redefine roles. If there is the role X defined in the root folder and
the user of the current request has got the role X defined too, then
the role of the user is replaced with the role of the structure. This
happens for all the roles of the user, if there are any redefinition in
the structure.
- It is important to understand that during processing there are roles
added or removed from the user, existing roles are just replaced with
roles having the same name but contain different permissions.
- The request with the updated user is then passed to next child within
the chain, etc.
- At the of the chain the given action (if there is nothing given, the
default action will be executed) is execute. By default actions have
the possibility to override the message #executePermission to assert
the permissions the user needs to execute it. If such an an permission
fails, the actions is aborted and error action is executed instead.
Now the structure itself is not involved, this means
that if I want to
have a special page that only a certain person can edit but everybody
else cannot I have to create a special role for that. Am I correct? Or
is it possible to grant permission at the instance level like a page?
Just define the anonymous role in that structure without the
edit-permissions.
Hope that helps,
Lukas
--
Lukas Renggli
http://renggli.freezope.org