7d7 @verb #101:"bf_set_property_info" this none this rxdo #55 @program #101:"bf_set_property_info" this none this perms = caller_perms() {object, propname, newinfo} = args {newowner, newperms, ?newname = {}} = newinfo {oldowner, oldperms} = property_info(object, propname) if (!valid(perms) || !perms:isa($accountable)) raise(E_PERM) elseif (!perms:controls_property(object, propname)) raise(E_PERM) elseif (!perms:controls(newowner)) raise(E_PERM) elseif (index(newperms, "w")) raise(E_INVARG, "+w properties are bad, bad...") elseif (!perms.wizard && !(propname in properties(object))) "Wizards are permitted to do this because of things like #45:set_owner, which changes the owner of +c properties when an object is chowned. Also, #101:bf_set_property_info calls itself on derived objects' stuff." "The property info of a property can now only be changed by changing the parent property. - Lao, Cecil, Dec 17 2001." raise(E_PROPNF, "That object does not define that property (it may be defined on a parent object)") endif if (index(newperms, "c")) newowner = object.owner endif "Sometimes you're just not allowed to specify a newname for a property, even if it's the same as oldname! We pass along the appropriate amount of incompetence from the actual call. - wk" pass(object, propname, {newowner, newperms, @newname}) "Maintain the same permissions for all children objects. If the perms are +c, make sure the owner of the property is the owner of the object. If the perms are -c, set owner to be newowner. Only the parent object now defines the permissions." for x in (children(object)) $bf_set_property_info(x, newname || propname, {index(newperms, "c") ? x.owner | newowner, newperms}) "I hate to put this suspend_if_needed in here, but the possible consequences of not setting the property info for every derived object is worse. - Lao." $cmd_utils:suspend_if_needed(0) endfor "Last modified by Lao-Tzu (#8084) on Tue Dec 18 11:47:58 2001 MST." . 0