Use the new Permission objects.

git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@600 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
Michael Bayne
2008-05-22 12:03:51 +00:00
parent 7890e26b43
commit ea6f8ffa1f
2 changed files with 7 additions and 16 deletions
@@ -24,6 +24,7 @@ package com.threerings.stage.data;
import com.threerings.util.MessageBundle;
import com.threerings.presents.data.InvocationCodes;
import com.threerings.presents.data.Permission;
import com.threerings.crowd.data.BodyObject;
@@ -38,13 +39,11 @@ public interface StageCodes extends InvocationCodes
/** The resource set that contains our tileset bundles. */
public static final String TILESET_RSRC_SET = "tilesets";
/** The access control identifier for scene modification privileges.
* See {@link BodyObject#checkAccess}. */
public static final String MODIFY_SCENE_ACCESS = "stage.modify_scene";
/** The access control identifier for scene modification privileges. */
public static final Permission MODIFY_SCENE_ACCESS = new Permission();
/** The access control identifier for potentially damaging scene
* modification privileges. See {@link BodyObject#checkAccess}. */
public static final String MUTILATE_SCENE_ACCESS = "stage.mutilate_scene";
/** The access control identifier for potentially damaging scene modification privileges. */
public static final Permission MUTILATE_SCENE_ACCESS = new Permission();
/** An error delivered when adding objects to scenes. */
public static final String ERR_NO_OVERLAP = MessageBundle.qualify(
@@ -176,11 +176,7 @@ public class StageSceneManager extends SpotSceneManager
StageSceneService.ConfirmListener listener)
throws InvocationException
{
BodyObject user = (BodyObject)caller;
String err = user.checkAccess(StageCodes.MODIFY_SCENE_ACCESS, _sscene);
if (err != null) {
throw new InvocationException(err);
}
InvocationException.requireAccess(caller, StageCodes.MODIFY_SCENE_ACCESS, _sscene);
if (addObject(info, false, true)) {
listener.requestProcessed();
@@ -194,11 +190,7 @@ public class StageSceneManager extends SpotSceneManager
StageSceneService.ConfirmListener listener)
throws InvocationException
{
BodyObject user = (BodyObject)caller;
String err = user.checkAccess(StageCodes.MODIFY_SCENE_ACCESS, _sscene);
if (err != null) {
throw new InvocationException(err);
}
InvocationException.requireAccess(caller, StageCodes.MODIFY_SCENE_ACCESS, _sscene);
// create our scene update which will be stored in the database
// and used to efficiently update clients