Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes
nsIPermissionManager Interface Reference

import "nsIPermissionManager.idl";

Inheritance diagram for nsIPermissionManager:
Inheritance graph
[legend]
Collaboration diagram for nsIPermissionManager:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void add (in nsIURI uri, in string type, in PRUint32 permission)
 Add permission information for a given URI and permission type.
void remove (in AUTF8String host, in string type)
 Remove permission information for a given URI and permission type.
void removeAll ()
 Clear permission information for all websites.
PRUint32 testPermission (in nsIURI uri, in string type)
 Test whether a website has permission to perform the given action.

Public Attributes

const PRUint32 UNKNOWN_ACTION = 0
 Predefined return values for the testPermission method and for the permission param of the add method.
const PRUint32 ALLOW_ACTION = 1
const PRUint32 DENY_ACTION = 2
readonly attribute
nsISimpleEnumerator 
enumerator
 Allows enumeration of all stored permissions.

Detailed Description

Definition at line 70 of file nsIPermissionManager.idl.


Member Function Documentation

void nsIPermissionManager::add ( in nsIURI  uri,
in string  type,
in 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.

Parameters:
urithe uri to add the permission for
typea 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.
permissionan 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.
Exceptions:
NS_ERROR_FAILUREif there is no more room for adding a new type
void nsIPermissionManager::remove ( in AUTF8String  host,
in string  type 
)

Remove permission information for a given URI and permission type.

Note that this method takes a host string, not an nsIURI.

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

Clear permission information for all websites.

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

Parameters:
urithe uri to be tested
typea case-sensitive ASCII string, identifying the consumer
returnsee add(), param permission. returns UNKNOWN_ACTION when there is no stored permission for this uri and / or type.

Member Data Documentation

Definition at line 77 of file nsIPermissionManager.idl.

Definition at line 78 of file nsIPermissionManager.idl.

Allows enumeration of all stored permissions.

Returns:
an nsISimpleEnumerator interface that allows access to nsIPermission objects

Definition at line 136 of file nsIPermissionManager.idl.

Predefined return values for the testPermission method and for the permission param of the add method.

Definition at line 76 of file nsIPermissionManager.idl.


The documentation for this interface was generated from the following file: