MOO-cows Mailing List Archive
[Prev][Next][Index][Thread]
Re: Multiple ownership
Dee wrote:
>1) create a .owners property on #1 of the type LIST
>2) do a little hacking in $perm_utils:controls to return ok if the user is
> *either* .owner or in .owners (and of course the wiz check)
>3) [optional] you might want to write verbs (mine are @add/rm-owner)
> to interface with the property for you.
The system I implemented in BioMOO is just the following:
@prog $perm_utils:controls
":controls(X, Y[, more info])";
"can X control Y? Yes if a) X is wiz, b) Y lets X control it, or c) Y's
owner lets X control it.";
return args[1].wizard ||
args[2]:is_controllable_by(@args) ||
args[2].owner:is_controllable_by(@args);
<finis>
In addition:
@verb $root_class:is_controllable_by tnt rx
@prog $root_class:is_controllable_by
return args[1] == this.owner;
<finis>
This system is very simple, yet enables various types of multiple ownership:
1) by object class: any class of objects can specify a special
:is_controllable_by to enable control by other users, e.g. from a list that
the object holds.
Example: a modification to $room to let its .residents control it fully.
2) by user class: a user class like $group_user can define a special
:is_controllable_by to enable whoever controls it to control any object
that it owns
Example: any controller of the BCD-programmer would be able to control
any object that BCD-programmer owns.
3) by user class, restricted: like the previous one, but using the 2nd
argument to restrict the extended control to a particular set of owned
objects.
Example: user A wants to enable user B to modify any of the notes that A
owns. A defines a :is_controllable_by on him/herself, that does:
return pass(@args) ||
(args[1]==<my friend> && $object_utils:isa(args[2],$note));
4) by even more defined conditions, if more arguments are passed to
$perm_utils:controls.
Example: $perm_utils:controls(player, somenote, "erase")
Again, some user might decide to allow his/her friends to control
partially his/her notes, permitting them to add text, but not to erase
them.
5) ... (your ideas here)
This system is mainly programmer-oriented. The system described in the
Dee's message is more builder-oriented, and they are complementary.
-------------------------------------------------------------
Gustavo Glusman Founder/administrator of BioMOO
-- Gustavo@bioinformatics.weizmann.ac.il
-- http://bioinformatics.weizmann.ac.il/Gustavo
-- BioMOO: telnet bioinformatics.weizmann.ac.il 8888
WWW: http://bioinfo.weizmann.ac.il:8888
Home |
Subject Index |
Thread Index