When a new default access controller is set, switch any objects
that were using the old default (usually null) to use the new default. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3369 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -79,7 +79,17 @@ public class PresentsDObjectMgr
|
|||||||
*/
|
*/
|
||||||
public void setDefaultAccessController (AccessController controller)
|
public void setDefaultAccessController (AccessController controller)
|
||||||
{
|
{
|
||||||
|
AccessController oldDefault = _defaultController;
|
||||||
_defaultController = controller;
|
_defaultController = controller;
|
||||||
|
|
||||||
|
// switch all objects from the old default (null, usually)
|
||||||
|
// to the new default
|
||||||
|
for (Iterator itr = _objects.elements(); itr.hasNext(); ) {
|
||||||
|
DObject obj = (DObject) itr.next();
|
||||||
|
if (oldDefault == obj.getAccessController()) {
|
||||||
|
obj.setAccessController(controller);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited from interface
|
// documentation inherited from interface
|
||||||
|
|||||||
Reference in New Issue
Block a user