Only set the default access controller when registering dobjects without an access controller
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6663 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -252,8 +252,12 @@ public class PresentsDObjectMgr
|
|||||||
|
|
||||||
// initialize this object
|
// initialize this object
|
||||||
object.setOid(oid);
|
object.setOid(oid);
|
||||||
object.setManager(PresentsDObjectMgr.this);
|
object.setManager(this);
|
||||||
object.setAccessController(_defaultController);
|
|
||||||
|
// set the default access controller if a controller hasn't already been specified
|
||||||
|
if (object.getAccessController() == null) {
|
||||||
|
object.setAccessController(_defaultController);
|
||||||
|
}
|
||||||
|
|
||||||
// insert it into the table
|
// insert it into the table
|
||||||
_objects.put(oid, object);
|
_objects.put(oid, object);
|
||||||
@@ -472,9 +476,15 @@ public class PresentsDObjectMgr
|
|||||||
// remove the object from the table
|
// remove the object from the table
|
||||||
_objects.remove(oid);
|
_objects.remove(oid);
|
||||||
|
|
||||||
// inactivate the object
|
// deactivate the object
|
||||||
target.setManager(null);
|
target.setManager(null);
|
||||||
|
|
||||||
|
// if it's using the default access controller, clear it out so it'll get the current
|
||||||
|
// default controller if it's reactivated.
|
||||||
|
if (target.getAccessController() == _defaultController) {
|
||||||
|
target.setAccessController(null);
|
||||||
|
}
|
||||||
|
|
||||||
// deal with any remaining oid lists that reference this object
|
// deal with any remaining oid lists that reference this object
|
||||||
Reference[] refs = _refs.remove(oid);
|
Reference[] refs = _refs.remove(oid);
|
||||||
if (refs != null) {
|
if (refs != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user