#include <jssecuritypolicy.h>
Public Types | |
enum | Capabilities { CapabilityTree = 0x0001, CapabilityGetProperties = 0x0002, CapabilitySetProperties = 0x0004, CapabilitySlots = 0x0008, CapabilityFactory = 0x0010, CapabilityTopLevel = 0x0020, CapabilityCustom = 0x4000, CapabilityNone = 0x0000, CapabilityReadOnly = CapabilityTree | CapabilityGetProperties, CapabilityReadWrite = CapabilityReadOnly | CapabilitySetProperties | CapabilitySlots, CapabilityAll = 0xffff } |
Public Member Functions | |
JSSecurityPolicy (uint capabilities=0) | |
virtual | ~JSSecurityPolicy () |
bool | hasCapability (uint cap) const |
void | setCapability (uint cap) |
void | clearCapability (uint cap) |
virtual bool | isInterpreterAllowed (const JSObjectProxy *prx, const KJS::Interpreter *interp) const |
virtual bool | isObjectAllowed (const JSObjectProxy *prx, const QObject *obj) const |
virtual bool | isPropertyAllowed (const JSObjectProxy *prx, const QObject *obj, const char *prop) const |
virtual bool | isCreateAllowed (const JSObjectProxy *prx, const QObject *parent, const QString &clazz, const QString &name) const |
Static Public Member Functions | |
JSSecurityPolicy * | defaultPolicy () |
void | setDefaultPolicy (JSSecurityPolicy *pol) |
void | setDefaultPolicy (uint capabilities) |
void | deleteDefaultPolicy () |
This class defines the interface for security policies, and provides a default implementation that should be sufficient for most situations.
A SecurityPolicy must define tests for the following situations:
The security policy applied by default is as follows:
|
Defines a set of flags that indicate if access to a given API should be allowed.
|
|
|
|
|
|
Specifies that the passed capabilities are disallowed.
|
|
Returns the default SecurityPolicy.
|
|
Deletes the default SecurityPolicy.
|
|
Returns true if any of the specified capabilities are allowed.
|
|
Returns true if scripts are allowed to create the specified child object.
|
|
Returns true if the specified interpreter may access the proxy.
|
|
Returns true if scripts are allowed to see the specified QObject.
|
|
Returns true if scripts are allowed to see the specified property.
|
|
Specifies that the passed capabilities are allowed.
|
|
Sets the default SecurityPolicy.
|
|
Sets the default SecurityPolicy.
|