Detailed Description

A security manager which defines what is accessible by Nitro.

Inheritance diagram for Nitro.NitroDomainManager:
PowerUI.UIScriptDomainManager

Public Member Functions

 NitroDomainManager ()
 Creates a default security manager which allows the Nitro and System namespaces. More...
 
void ClearDefaultReferences ()
 Clears all default references. More...
 
List< CodeReferenceGetDefaultReferences ()
 Gets the default references. More...
 
bool AllowsEverything ()
 This value states if this domain allows every type. Do note that the NitroDomainManager type is always blocked. More...
 
bool IsAllowed (Type type)
 Checks if the named type is allowed by this domain. More...
 
virtual bool AllowAccess (string protocol, string host, string fullPath)
 Checks if the given remote location is allowed any access at all. Note that this can internally update the domain itself if it wants to apply further restrictions. More...
 

Static Public Member Functions

static NitroDomainManager GetDefaultManager ()
 Gets the default security manager. More...
 

Protected Member Functions

void AddReference (string text)
 Adds the given text as a reference. Must also include the assembly unless it is in 'this' one. More...
 
void AllowEverything ()
 Call this to make this domain allow any type except for those in its block list. More...
 
void Allow (string name)
 Lets this domain allow the given type/ namespace. You must derive this class and call this from within the constructor. More...
 
void Block (string name)
 Lets this domain block the given type/ namespace. Used when this domain allows everything except a certain few. You must derive this class and call this from within the constructor. More...
 

Private Member Functions

bool Blocked (Type type)
 Checks if the given type is blocked by this domain. More...
 

Private Attributes

bool AllowAll
 True if this domain allows everything. More...
 
List< SecureNameBlockedNames
 A set of all blocked types by name. More...
 
List< CodeReferenceDefaultReferences
 A set of classes included and allowed by default. More...
 
List< SecureNameAllowedNames =new List<SecureName>()
 A set of all allowed types by name. More...
 

Static Private Attributes

static NitroDomainManager DefaultManager =new NitroDomainManager()
 The default security manager if none is provided. More...
 

Constructor & Destructor Documentation

Nitro.NitroDomainManager.NitroDomainManager ( )
inline

Creates a default security manager which allows the Nitro and System namespaces.

Member Function Documentation

void Nitro.NitroDomainManager.AddReference ( string  text)
inlineprotected

Adds the given text as a reference. Must also include the assembly unless it is in 'this' one.

Parameters
textThe reference to add, e.g. "Nitro" or "System.System".
void Nitro.NitroDomainManager.Allow ( string  name)
inlineprotected

Lets this domain allow the given type/ namespace. You must derive this class and call this from within the constructor.

Parameters
nameThe type/ namespace to allow.
virtual bool Nitro.NitroDomainManager.AllowAccess ( string  protocol,
string  host,
string  fullPath 
)
inlinevirtual

Checks if the given remote location is allowed any access at all. Note that this can internally update the domain itself if it wants to apply further restrictions.

Parameters
protocolThe protocol:// of the remote location. Lowercase and usually e.g. http(s).
hostThe first part of the location after the protocol. E.g. www.kulestar.com.
fullPathThe whole path requesting access. E.g. http://www.kulestar.com/.
void Nitro.NitroDomainManager.AllowEverything ( )
inlineprotected

Call this to make this domain allow any type except for those in its block list.

bool Nitro.NitroDomainManager.AllowsEverything ( )
inline

This value states if this domain allows every type. Do note that the NitroDomainManager type is always blocked.

Returns
True if it allows every type, false otherwise.
void Nitro.NitroDomainManager.Block ( string  name)
inlineprotected

Lets this domain block the given type/ namespace. Used when this domain allows everything except a certain few. You must derive this class and call this from within the constructor.

Parameters
nameThe name of the type/ namespace to block.
bool Nitro.NitroDomainManager.Blocked ( Type  type)
inlineprivate

Checks if the given type is blocked by this domain.

Parameters
typeThe type to check for.
Returns
True if this domain blocks the named type.
void Nitro.NitroDomainManager.ClearDefaultReferences ( )
inline

Clears all default references.

static NitroDomainManager Nitro.NitroDomainManager.GetDefaultManager ( )
inlinestatic

Gets the default security manager.

List<CodeReference> Nitro.NitroDomainManager.GetDefaultReferences ( )
inline

Gets the default references.

Returns
The list of default code references.
bool Nitro.NitroDomainManager.IsAllowed ( Type  type)
inline

Checks if the named type is allowed by this domain.

Parameters
nameThe type to check for.
Returns
True if the type is allowed by this domain.

Member Data Documentation

bool Nitro.NitroDomainManager.AllowAll
private

True if this domain allows everything.

List<SecureName> Nitro.NitroDomainManager.AllowedNames =new List<SecureName>()
private

A set of all allowed types by name.

List<SecureName> Nitro.NitroDomainManager.BlockedNames
private

A set of all blocked types by name.

NitroDomainManager Nitro.NitroDomainManager.DefaultManager =new NitroDomainManager()
staticprivate

The default security manager if none is provided.

List<CodeReference> Nitro.NitroDomainManager.DefaultReferences
private

A set of classes included and allowed by default.