Sirikata
|
Sister file in em, is in scripts/std/shim/capabilities.em. More...
#include <JSCapabilitiesConsts.hpp>
Public Types | |
enum | Caps { SEND_MESSAGE = 1, RECEIVE_MESSAGE = 2, IMPORT = 4, CREATE_PRESENCE = 8, CREATE_ENTITY = 16, EVAL = 32, PROX_CALLBACKS = 64, PROX_QUERIES = 128, CREATE_SANDBOX = 256, GUI = 512, HTTP = 1024, MOVEMENT = 2048, MESH = 4096 } |
typedef int | CapNum |
Static Public Member Functions | |
static CapNum | getFullCapabilities () |
static bool | givesCap (CapNum capabilitiesNum, Caps checkingCap, JSPresenceStruct *ctxPres=NULL, JSPresenceStruct *onPres=NULL) |
Static Private Member Functions | |
static bool | presenceSpecificCap (Caps checkingCap) |
Sister file in em, is in scripts/std/shim/capabilities.em.
Make change to this file, means I should make change to that file. Similaraly, any changes to capabilities should also be registered in JSSystemStruct.cpp's struct_createContext
typedef int Sirikata::JS::Capabilities::CapNum |
Capabilities::CapNum Sirikata::JS::Capabilities::getFullCapabilities | ( | ) | [static] |
References CREATE_ENTITY, CREATE_PRESENCE, CREATE_SANDBOX, EVAL, GUI, HTTP, IMPORT, MESH, MOVEMENT, PROX_CALLBACKS, PROX_QUERIES, RECEIVE_MESSAGE, and SEND_MESSAGE.
Referenced by Sirikata::JS::JSObjectScript::initialize().
bool Sirikata::JS::Capabilities::givesCap | ( | CapNum | capabilitiesNum, |
Caps | checkingCap, | ||
JSPresenceStruct * | ctxPres = NULL , |
||
JSPresenceStruct * | onPres = NULL |
||
) | [static] |
{int} | capabilitiesNum Bitwise-or of all listed capabilities |
{Caps} | checkingCap checking whether the capabilitiesNum permits this capability (optionally) on the presesences below |
{JSPresenceStruct} | ctxPres Some capabilities are restricted to particular presences (eg. PROX_CALLBACKS). For this set, check whether ctxPres is same as onPres before checking whether have capability to perform action. If they aren't the same, means sandbox is trying to perform an action on one of the presences it created, and we can just permit the operation. |
References Sirikata::Logging::error, JSLOG, and presenceSpecificCap().
Referenced by Sirikata::JS::JSObjectScript::checkCurCtxtHasCapability(), Sirikata::JS::JSSystemStruct::restorePresence(), Sirikata::JS::JSSystemStruct::struct_canCreateEnt(), Sirikata::JS::JSSystemStruct::struct_canCreatePres(), Sirikata::JS::JSSystemStruct::struct_canEval(), Sirikata::JS::JSSystemStruct::struct_canImport(), Sirikata::JS::JSSystemStruct::struct_canProxCallback(), Sirikata::JS::JSSystemStruct::struct_canProxChangeQuery(), Sirikata::JS::JSSystemStruct::struct_canRecvMessage(), Sirikata::JS::JSSystemStruct::struct_canSendMessage(), Sirikata::JS::JSSystemStruct::struct_createEntity(), Sirikata::JS::JSSystemStruct::struct_evalInGlobal(), Sirikata::JS::JSSystemStruct::struct_import(), and Sirikata::JS::JSSystemStruct::struct_require().
bool Sirikata::JS::Capabilities::presenceSpecificCap | ( | Caps | checkingCap | ) | [static, private] |
References MESH, MOVEMENT, PROX_CALLBACKS, PROX_QUERIES, RECEIVE_MESSAGE, and SEND_MESSAGE.
Referenced by givesCap().