external next up previous contents index
Next: Adding security to the Up: 8.10 Permissions and Generic Previous: A short look at

A generic ``holder''


The first an easy step in creating a generic object is to change permissions to make it fertile. Do that now !

Now we have to mention a somewhat tricker issue: the ``c'' permissions. Here are the ground rules:

  1. If you have a c permission set on a property, the owner of the kid will own this property, meaning they can set it to any value they wish, but the verbs you programmed won't be able to change the value of a such a property.
  2. If you remove the c permission on a property, then you will be the owner of the property on the kids. This means that the owner can't change them, but the verbs you programmed can.
  3. The trouble is that all inherited verbs run with permissions on YOU. This means that those verbs can not change properties on kids. Yes and verbs are NOT copied onto kids.

Now let's look at the holder example. You now should have it fertile, if not, do that. Now TELL SOMEBODY ELSE to create a kid of holder (give the person the object number or bring him to the room where your holder sits on the floor.

   @create #... named test

Now tell him to 'add ...' something, but it won't work as you can see in the transcript below

   >add this to test
   #2108:add (this == #2263), line 1:  Permission denied
   (End of traceback)

Now your friend should recycle the object, i.e. kill it because it is useless, i.e. he should type:

   @recycle test

Note that YOU could create kids that work, since the owner of the generic and the owner of the kid is yourself.

The solution to the problem is to change permission of all properties whose values are set by a verb on the generic to ``-c''. Now type something like this:

  @chmod holder.holding -c

Now your friends could create kids of your holder that work. The trouble now is that they can't change those properties by hand (as some persons might be tempted to do, i.e. for them, something like:

  ;#12347.holding = {}
  @set test.holding to {}

would not work. If you want to allow that, there are 2 solutions both of which are not great:

  1. You can change permissions on holder-holding to +w. This way both your verbs work and the owner can change the ``.holding'' property. BUT, anybody could do that too.
  2. You can tell people to copy the verbs from you. But this is a waste of MOO space (unless they create a new and better generic object layer for the holding.

Without doubt, there is still more to be said about permissions, but for simple projects, you should be all set.

Further reading on permissions:

next up previous contents index external
Next: Adding security to the Up: 8.10 Permissions and Generic Previous: A short look at

Daniel K. Schneider
Thu Apr 17 12:43:52 MET DST 1997