nsIPermissionManager

IID:4F6B5E00-0C36-11d5-A535-0010A401EB10
Inherits From:nsISupports

This interface is implemented by the following components:


Constants

Predefined return values for the testPermission method and for the permission param of the add method
PRUint32 UNKNOWN_ACTION = 0
PRUint32 ALLOW_ACTION = 1
PRUint32 DENY_ACTION = 2

Properties

readonly nsISimpleEnumerator enumerator

Allows enumeration of all stored permissions


Methods

void add ( nsIURI uri , char* type , PRUint32 permission ) void remove ( AUTF8String host , char* type ) void removeAll ( ) PRUint32 testPermission ( nsIURI uri , char* type )

void add ( nsIURI uri , char* type , PRUint32 permission )

Add permission information for a given URI and permission type. This operation will cause the type string to be registered if it does not currently exist.

Arguments:
uri: the uri to add the permission for
type: a case-sensitive ASCII string, identifying the consumer. Consumers should choose this string to be unique, with respect to other consumers. The number of unique type indentifiers may be limited.
permission: an integer from 1 to 15, representing the desired action (e.g. allow or deny). The interpretation of this number is up to the consumer, and may represent different actions for different types. Consumers may use one of the enumerated permission actions defined above. 0 is reserved for UNKNOWN_ACTION, and shouldn't be used.

void remove ( AUTF8String host , char* type )

Remove permission information for a given URI and permission type. Note that this method takes a host string, not an nsIURI.

Arguments:
host: the host to remove the permission for
type: a case-sensitive ASCII string, identifying the consumer. The type must have been previously registered using the add() method.

void removeAll ( )

Clear permission information for all websites.


PRUint32 testPermission ( nsIURI uri , char* type )

Test whether a website has permission to perform the given action.

Arguments:
uri: the uri to be tested
type: a case-sensitive ASCII string, identifying the consumer

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
No comments available

Copyright © 1999 - 2005 XULPlanet.com