[ewiki] Re: Flags! Flags?
- From: "Mario Salzer" <mario@xxxxxxxxxxxxx>
- To: ewiki@xxxxxxxxxxxxx
- Date: Mon, 3 Nov 2003 23:49:41 +0100
Hey,
Because I changed that code yesterday over and over again, there may be a
chance that it is working now (and again), however code reviews are always
good and especially these few lines are to be rewritten again soon...
> Mario, could you explain how the flags are defined? Looking at the
Of course! I'm well aware, that the README is not very detailed about the
page flags and partially outdated again (uuugh).
_WRITEABLE indicates that a page may be edited, regardless of any other flag
or any auth_ plugin or PROTECTED_MODE setting. It has the highest priority
within the edit/ action, and is particularly only useful for highly restricted
Wikis,
where you want just one or two pages (GuestBook, SandBox) to be editable by
the larger public.
_READONLY indicates the opposite and as page {flag} again has precedence
over what the ewiki_auth() says. Useful for open Wikis, where everyone is
allowed to edit pages in the first place; but just a few are to be protected
(the FrontPage for example).
_APPENDONLY is fake right now.
_HTML is a feature flag, and allows to use html inside wikipages, if it wasn't
already allowed globally for all pages (some other config constant).
_TEXT
_BINARY
_DISABLED
_SYSTEM
These four make up the page type. Ordinary pages are _TEXT ones and
have only that flag setted. Otherwise they are not editable with the edit/
action.
Of course it wouldn't be senseful to let users edit _BINARY "pages", because
these are usually uploaded images. The _DISABLED can be set to temporarily
make a page unusable, only admins and moderators (see below) can then
edit it.
The _SYSTEM is for future use (a mix of _TEXT and _BINARY and _DISABLED)
and pages marked as those then contain config data or user profiles, search
database cache things and the like, and therefore are not to be edited by
ordinary users (only superuser may do).
#
The ewiki_auth() and the PROTECTED_MODE now uses the $ewiki_ring
method to classify users into groups. I didn't exactly specify what I meant with
this in the README, so here is now how ewiki handles the $ring levels.
If the _PROTECTED_MODE is enabled, then it is highly recommended to let the
parent CMS / container site set the $ewiki_ring variable. Some of the current
code is unclean and thus may fail. Otherwise the meaning of the $ewiki_ring
if following:
$ring==0 super-user (can access _SYSTEM pages and do everything)
$ring==1 moderator (advanced privileges, may allow locking + deleting pages)
$ring==2 editor (ordinary user, can edit wikipages)
$ring==3 guest, browsing/viewing only
There are just those four levels in the core PROTECTED_MODE ring model,
however the ewiki_auth() allows much complexer things and can completely
ignore $ewiki_ring to base decisions on any available authentication and
permission data and schemes.
Regards,
mario
________________________________________________________________
Mit der Grupppen-SMS von WEB.DE FreeMail können Sie eine SMS an alle
Freunde gleichzeitig schicken: http://freemail.web.de/features/?mc=021179
Other related posts: