From 2495be9ecfa8aea47e285f63b5bb27b0c133b1f8 Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Mon, 30 Jun 2014 23:03:03 +0200 Subject: Separated modifying Lookup methods into LookupManager, which is only present in a server process. This stops clients trying to write to the directory without relying on their permissions. --- src/main/java/com/c2kernel/lookup/RolePath.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/main/java/com/c2kernel/lookup/RolePath.java') diff --git a/src/main/java/com/c2kernel/lookup/RolePath.java b/src/main/java/com/c2kernel/lookup/RolePath.java index bd23991..fa37fb3 100644 --- a/src/main/java/com/c2kernel/lookup/RolePath.java +++ b/src/main/java/com/c2kernel/lookup/RolePath.java @@ -13,6 +13,7 @@ package com.c2kernel.lookup; import java.util.ArrayList; import java.util.Iterator; +import com.c2kernel.common.CannotManageException; import com.c2kernel.common.ObjectCannotBeUpdated; import com.c2kernel.common.ObjectNotFoundException; import com.c2kernel.process.Gateway; @@ -51,10 +52,11 @@ public class RolePath extends DomainPath * @param hasJobList The hasJobList to set. * @throws ObjectCannotBeUpdated * @throws ObjectNotFoundException + * @throws CannotManageException */ - public void setHasJobList(boolean hasJobList) throws ObjectNotFoundException, ObjectCannotBeUpdated { + public void setHasJobList(boolean hasJobList) throws ObjectNotFoundException, ObjectCannotBeUpdated, CannotManageException { this.hasJobList = hasJobList; - Gateway.getLookup().setHasJobList(this, hasJobList); + Gateway.getLookupManager().setHasJobList(this, hasJobList); } @@ -80,12 +82,12 @@ public class RolePath extends DomainPath } } - public void addAgent(AgentPath agent) throws ObjectCannotBeUpdated, ObjectNotFoundException { - Gateway.getLookup().addRole(agent, this); + public void addAgent(AgentPath agent) throws ObjectCannotBeUpdated, CannotManageException, ObjectNotFoundException { + Gateway.getLookupManager().addRole(agent, this); } - public void removeAgent(AgentPath agent) throws ObjectCannotBeUpdated, ObjectNotFoundException { - Gateway.getLookup().removeRole(agent, this); + public void removeAgent(AgentPath agent) throws ObjectCannotBeUpdated, CannotManageException, ObjectNotFoundException { + Gateway.getLookupManager().removeRole(agent, this); } @Override -- cgit v1.2.3