Back to index

lightning-sunbird  0.9+nobinonly
nsISecurityContext.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
00002  *
00003  * ***** BEGIN LICENSE BLOCK *****
00004  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00005  *
00006  * The contents of this file are subject to the Mozilla Public License Version
00007  * 1.1 (the "License"); you may not use this file except in compliance with
00008  * the License. You may obtain a copy of the License at
00009  * http://www.mozilla.org/MPL/
00010  *
00011  * Software distributed under the License is distributed on an "AS IS" basis,
00012  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00013  * for the specific language governing rights and limitations under the
00014  * License.
00015  *
00016  * The Original Code is Mozilla Communicator client code, released
00017  * March 31, 1998.
00018  *
00019  * The Initial Developer of the Original Code is
00020  * Netscape Communications Corporation.
00021  * Portions created by the Initial Developer are Copyright (C) 1998
00022  * the Initial Developer. All Rights Reserved.
00023  *
00024  * Contributor(s):
00025  *
00026  * Alternatively, the contents of this file may be used under the terms of
00027  * either of the GNU General Public License Version 2 or later (the "GPL"),
00028  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00029  * in which case the provisions of the GPL or the LGPL are applicable instead
00030  * of those above. If you wish to allow use of your version of this file only
00031  * under the terms of either the GPL or the LGPL, and not to allow others to
00032  * use your version of this file under the terms of the MPL, indicate your
00033  * decision by deleting the provisions above and replace them with the notice
00034  * and other provisions required by the GPL or the LGPL. If you do not delete
00035  * the provisions above, a recipient may use your version of this file under
00036  * the terms of any one of the MPL, the GPL or the LGPL.
00037  *
00038  * ***** END LICENSE BLOCK ***** */
00039 /*
00040  * This file is part of the Java-vendor-neutral implementation of LiveConnect
00041  *
00042  * It contains the public XP-COM based interface for java to javascript communication.
00043  * This interface allows java and javascript to exchange security contexts to allow
00044  * access to restricted resources on either side.
00045  *
00046  */
00047 
00048 #ifndef nsISecurityContext_h___
00049 #define nsISecurityContext_h___
00050 
00051 #include "nsISupports.h"
00052 
00053 #define NS_ISECURITYCONTEXT_IID                          \
00054 { /* {209B1120-4C41-11d2-A1CB-00805F8F694D} */         \
00055     0x209b1120,                                      \
00056     0x4c41,                                          \
00057     0x11d2,                                          \
00058     { 0xa1, 0xcb, 0x0, 0x80, 0x5f, 0x8f, 0x69, 0x4d } \
00059 }
00060 
00061 class nsISecurityContext : public nsISupports {
00062 public:
00063 
00064     NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISECURITYCONTEXT_IID)
00065 
00066     
00075     NS_IMETHOD Implies(const char* target, const char* action, PRBool *bAllowedAccess) = 0;
00076 
00085     NS_IMETHOD GetOrigin(char* buf, int len) = 0;
00086 
00095     NS_IMETHOD GetCertificateID(char* buf, int len) = 0;
00096 };
00097 
00098 
00099 // Supported targets in Netscape Navigator 4.0 (Communicator): 
00100 
00101 #define nsSecurityTarget_UniversalThreadAccess "UniversalThreadAccess"       // allows manipulation of threads not belonging to the applet  
00102 #define nsSecurityTarget_UniversalExecAccess "UniversalExecAccess"           // allows executing sub-processes  
00103 #define nsSecurityTarget_UniversalExitAccess "UniversalExitAccess"           // allows terminating the browser session  
00104 #define nsSecurityTarget_UniversalLinkAccess "UniversalLinkAccess"           // allows linking to dymanically loaded libraries (DLLs)  
00105 #define nsSecurityTarget_UniversalPropertyWrite "UniversalPropertyWrite"     // allows reading and writing of all system properties (vs. restrictions on applets)  
00106 #define nsSecurityTarget_UniversalPropertyRead "UniversalPropertyRead"       // allows reading of all system properties (vs. restrictions on applets)  
00107 #define nsSecurityTarget_UniversalFileRead "UniversalFileRead"               // allows reading any file in the local filesystem  
00108 #define nsSecurityTarget_UniversalFileWrite "UniversalFileWrite"             // allows writing any file in the local filesystem  
00109 #define nsSecurityTarget_UniversalFileDelete "UniversalFileDelete"           // allows deleting of any file in the local filesystem  
00110 #define nsSecurityTarget_UniversalFdRead "UniversalFdRead"                   // allows reading from any arbitrary file descriptor  
00111 #define nsSecurityTarget_UniversalFdWrite "UniversalFdWrite"                 // allows writing to any arbitrary file descriptor  
00112 #define nsSecurityTarget_UniversalListen "UniversalListen"                   // allows establishing the server-side of a network connection  
00113 #define nsSecurityTarget_UniversalAccept "UniversalAccept"                   // allows waiting on a network connection  
00114 #define nsSecurityTarget_UniversalConnect "UniversalConnect"                 // allows establishing the client-side of a network connection  
00115 #define nsSecurityTarget_UniversalMulticast "UniversalMulticast"             // allows establishing IP multicast a network connection  
00116 #define nsSecurityTarget_UniversalTopLevelWindow "UniversalTopLevelWindow"   // allows top-level windows to be created by the applet writer.  
00117 #define nsSecurityTarget_UniversalPackageAccess "UniversalPackageAccess"     // allows access to java packages  
00118 #define nsSecurityTarget_UniversalPackageDefinition "UniversalPackageDefinition" // allows access to define packages  
00119 #define nsSecurityTarget_UniversalSetFactory "UniversalSetFactory"           // allows access to set a networking-related object factory  
00120 #define nsSecurityTarget_UniversalMemberAccess "UniversalMemberAccess"       // allows access to members of a class  
00121 #define nsSecurityTarget_UniversalPrintJobAccess "UniversalPrintJobAccess"   // allows access to initiate a print job request  
00122 #define nsSecurityTarget_UniversalSystemClipboardAccess "UniversalSystemClipboardAccess" // allows access to System Clipboard  
00123 #define nsSecurityTarget_UniversalAwtEventQueueAccess "UniversalAwtEventQueueAccess"     // allows access to Awt's EventQueue  
00124 #define nsSecurityTarget_UniversalSecurityProvider "UniversalSecurityProvider" // allows access to certain operations to a given provider, for example, only a given provider (e.g. Netscape) is able to retrieve the Netscape provider properties  
00125 #define nsSecurityTarget_UniversalBrowserRead "UniversalBrowserRead"           // allows access to browser data  
00126 #define nsSecurityTarget_UniversalBrowserWrite "UniversalBrowserWrite"         // allows modification of browser data  
00127 #define nsSecurityTarget_UniversalSendMail "UniversalSendMail"              // allows sending mail  
00128 #define nsSecurityTarget_SuperUser "SuperUser"                              // enables all privileges  
00129 #define nsSecurityTarget_30Capabilities "30Capabilities"                    // enables all privileges that are available in Navigator 3.0.  
00130 #define nsSecurityTarget_UniversalFileAccess "UniversalFileAccess"          // enables read, write and delete of any file in the local filesystem  
00131 #define nsSecurityTarget_TerminalEmulator "TerminalEmulator"                // enables socket connections, property read and to link dynamic libraries.  
00132 
00133 
00134 
00135 #endif // nsISecurityContext_h___