serviceapifw_plat/rtsecuritymanager_client_api/inc/rtsecmgrscriptsession.h
changeset 57 61b27eec6533
parent 45 7aa6007702af
equal deleted inserted replaced
45:7aa6007702af 57:61b27eec6533
     1 /*
       
     2 * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:       Client side proxy class representing script session
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 #ifndef _CRTSECMGRSCRIPTSESSION_H_
       
    25 #define	_CRTSECMGRSCRIPTSESSION_H_
       
    26 
       
    27 #include <rtsecmanager.rsg>
       
    28 #include <rtsecmgrcommondef.h>
       
    29 #include <rtsecmgrpermission.h>
       
    30 #include <rtsecmgrscript.h>
       
    31 #include <rtsecmgrtrustinfo.h>
       
    32 
       
    33 class CCoeEnv;
       
    34 class CRTSecMgrSubSessionProxy;
       
    35 
       
    36 /**
       
    37  * Type holding data to be used while prompting. 
       
    38  * 
       
    39  * The default or custom (runtime over-ridden) prompt handler requires the permission
       
    40  * type to prompt and the user-selection to be returned to security 
       
    41  * manager for access permission check
       
    42  * 
       
    43  * @lib rtsecmgrclient.lib
       
    44  */
       
    45 class CPromptData : public CBase
       
    46 	{
       
    47 public:
       
    48 
       
    49 	/**
       
    50 	 * Two-phased constructor
       
    51 	 * 
       
    52 	 * Constructs a CPromptData instance
       
    53 	 *
       
    54 	 * @return pointer to an instance of CPromptData
       
    55 	 */
       
    56 	static CPromptData* NewL()
       
    57 		{
       
    58 		CPromptData* self = CPromptData::NewLC ();
       
    59 		CleanupStack::Pop (self);
       
    60 		return self;
       
    61 		}
       
    62 
       
    63 	/**
       
    64 	 * Two-phased constructor
       
    65 	 * 
       
    66 	 * Constructs a CPromptData instance and leaves the created instance
       
    67 	 * onto the cleanupstack.
       
    68 	 *
       
    69 	 * @return pointer to an instance of CPromptData
       
    70 	 */
       
    71 	
       
    72 	static CPromptData* NewLC()
       
    73 		{
       
    74 		CPromptData* self = new (ELeave) CPromptData();
       
    75 		CleanupStack::PushL (self);
       
    76 		self->ConstructL ();
       
    77 		return self;
       
    78 		}
       
    79 		
       
    80 
       
    81 	/**
       
    82 	 * Destructor
       
    83 	 * 
       
    84 	 */
       
    85 	~CPromptData()
       
    86 		{
       
    87 		if(iPermission)
       
    88 			delete iPermission;
       
    89 		
       
    90 		}
       
    91 
       
    92 	
       
    93 	/*
       
    94 	 *
       
    95 	 *
       
    96 	 */
       
    97 	void ConstructL()
       
    98 	{
       
    99 		
       
   100 	}
       
   101 	
       
   102 	/**
       
   103 	 * Returns permission data
       
   104 	 * 
       
   105 	 * @return an object containing the permission data
       
   106 	 */
       
   107 	inline CPermission* Permission() const
       
   108 		{
       
   109 		return iPermission;
       
   110 		}
       
   111 
       
   112 	/**
       
   113 	 * Sets the user-selection data
       
   114 	 * 
       
   115 	 * @param aUserSelection TUserPromptOption user-selected data value
       
   116 	 */
       
   117 	inline void SetUserSelection(TUserPromptOption aUserSelection)
       
   118 		{
       
   119 		iUserSelection = aUserSelection;
       
   120 		}
       
   121 		
       
   122 	/**
       
   123 	 * Sets the permission value of the domain
       
   124 	 * 
       
   125 	 * @param aPermission CPermission permission value of the domain
       
   126 	 */
       
   127 	 
       
   128 	inline void SetPermissions(CPermission& aPermission)
       
   129 		{	
       
   130 		 if(iPermission)
       
   131 		 {
       
   132 		 	delete iPermission;
       
   133 		 	iPermission = NULL;
       
   134 		 }
       
   135 		 
       
   136 		 iPermission = CPermission::NewL(aPermission);
       
   137  		//iPermission = &aPermission;
       
   138 		}
       
   139 private:
       
   140 	//private default constructor
       
   141 	CPromptData::CPromptData() :
       
   142 		iUserSelection(RTUserPrompt_UnDefined)
       
   143 		{
       
   144 		}
       
   145 
       
   146 	//private permission data
       
   147 	CPermission* iPermission;
       
   148 
       
   149 	//private user-selection
       
   150 	TUserPromptOption iUserSelection;
       
   151 
       
   152 	friend class CRTSecMgrScriptSession;
       
   153 	};
       
   154 
       
   155 //typdef to model list of prompt data structure
       
   156 typedef RPointerArray<CPromptData> RPromptDataList;
       
   157 typedef RArray<TInt> RResourceArray; 
       
   158 
       
   159 /* 
       
   160  * Prompt callback handler class. 
       
   161  * 
       
   162  * Runtimes should implement the prompt handler function to prompt the user 
       
   163  * and to obtain the user option chosen. The prompt data are used by
       
   164  * runtime security manager for further access permission check. 
       
   165  * 
       
   166  * If runtimes do not override prompt handling, security manager component 
       
   167  * would then provide default prompt handler functionality.
       
   168  *
       
   169  * @lib rtsecmgrclient.lib
       
   170  */
       
   171 class MSecMgrPromptHandler
       
   172 	{
       
   173 public:
       
   174 	/**
       
   175 	 * Prompts the user.
       
   176 	 * 
       
   177 	 * @param aPromptDataList RPromptDataList list of prompt data used by
       
   178 	 * prompt callback handler to show to the user
       
   179 	 * 
       
   180 	 * @return KErrNone if prompting successful; In case of failure, one of
       
   181 	 * system wide error codes
       
   182 	 */
       
   183 	virtual TInt Prompt(RPromptDataList& aPromptDataList , TExecutableID aExecID  = KAnonymousScript) =0;
       
   184 
       
   185 	/**
       
   186 	 * Sets the user chosen prompt selection.
       
   187 	 * 
       
   188 	 * @param aPromptUiOption TSecMgrPromptUIOption prompt selection
       
   189 	 */
       
   190 	virtual void SetPromptOption(TSecMgrPromptUIOption aPromptUiOption) =0;
       
   191 	/**
       
   192 	 * Returns the prompt selection
       
   193 	 * 
       
   194 	 * @return TSecMgrPromptUIOption the prompt selection
       
   195 	 */
       
   196 	virtual TSecMgrPromptUIOption PromptOption() const =0;
       
   197 	};
       
   198 
       
   199 struct TPermanentInfo
       
   200     {
       
   201     TPermGrant iAllowedBits;            //permanent allowed caps
       
   202     TPermGrant iDeniedBits;             //permanent denied caps
       
   203     RProviderArray iAllowedProviders;   //permanent allowed providers
       
   204     RProviderArray iDeniedProviders;    //permanent denied providers
       
   205     };
       
   206 
       
   207 struct TSessionInfo
       
   208     {
       
   209     TCapabilityBitSet AllowedCaps; //caps allowed for this session (caps allowed for this session & perm allowed)
       
   210     TCapabilityBitSet DeniedCaps; //caps denied for this sesion (caps denied for this session & perm denied)
       
   211     RProviderArray AllowedProviders;//providers allowed for this session
       
   212     RProviderArray DeniedProviders;//providers denied for this session
       
   213     };
       
   214 
       
   215 /**
       
   216  *
       
   217  * Thin proxy to the client side sub-session handle. 
       
   218  * 
       
   219  * This class implements the default prompt handling functionality. In addition, the main
       
   220  * functionality of native platform access check is performed by CRTSecMgrScriptSession.
       
   221  *
       
   222  * @lib rtsecmgrclient.lib
       
   223  * 
       
   224  */
       
   225 NONSHARABLE_CLASS(CRTSecMgrScriptSession) : public CBase, MSecMgrPromptHandler
       
   226 	{
       
   227 public:
       
   228 	/**
       
   229 	 * Two-phased constructor
       
   230 	 * 
       
   231 	 * Constructs a CRTSecMgrScriptSession instance
       
   232 	 *
       
   233 	 * Initializes client side script sub-session. 
       
   234 	 * 
       
   235 	 * @param MSecMgrPromptHandler pointer to a prompt handler callback
       
   236 	 * 
       
   237 	 * @return pointer to an instance of CRTSecMgrScriptSession if succesful; 
       
   238 	 * Otherwise NULL
       
   239 	 */
       
   240 	static CRTSecMgrScriptSession* NewL(MSecMgrPromptHandler* aPromptHdlr=0);
       
   241 
       
   242 	/**
       
   243 	 * Two-phased constructor
       
   244 	 * 
       
   245 	 * Constructs a CRTSecMgrScriptSession instance and leaves the created instance
       
   246 	 * on the cleanupstack
       
   247 	 *
       
   248 	 * Initializes client side script sub-session. 
       
   249 	 * 
       
   250 	 * @param MSecMgrPromptHandler pointer to a prompt handler callback
       
   251 	 * 
       
   252 	 * @return pointer to an instance of CRTSecMgrScriptSession if succesful; 
       
   253 	 * Otherwise NULL
       
   254 	 */
       
   255 	static CRTSecMgrScriptSession* NewLC(MSecMgrPromptHandler* aPromptHdlr=0);
       
   256 	
       
   257 	/**
       
   258 	 * Callback funciton for moreinfo link in advanced prompt
       
   259 	 * 
       
   260 	 * Calls the moreinfo function for indivudual capability or for a alias group
       
   261 	 * 
       
   262 	 * @param aCallbackParam TAny* pointer to TCallbackParam
       
   263 	 * 
       
   264 	 */
       
   265   static TInt LinkCallback(TAny *aCallbackParam);
       
   266 
       
   267 	/**
       
   268 	 * Destructor
       
   269 	 * 
       
   270 	 * Closes the sub-session
       
   271 	 *
       
   272 	 */
       
   273 	IMPORT_C ~CRTSecMgrScriptSession();
       
   274 
       
   275 	/**
       
   276 	 * Opens security manager script sub-session. This method in turn opens a
       
   277 	 * sub-session on the server side, by bringing script related data onto the cache. 
       
   278 	 * 
       
   279 	 * @param aParentSession RSessionBase handle to parent security manager session
       
   280 	 * @param aPolicyID TPolicyID policy identifier of the script associated with this script session
       
   281 	 * @param aExecID TExecutableID identifier of the script associated with this script session
       
   282 	 * 
       
   283 	 * @return KErrNone if successful; In case of failure, one of system wide error cods
       
   284 	 */
       
   285 	TInt Open(const RSessionBase& aParentSession,TPolicyID aPolicyID,TExecutableID aExecID);
       
   286 
       
   287 	/**
       
   288 	 * Opens security manager script sub-session. This method in turn opens a
       
   289 	 * sub-session on the server side, by bringing script related data onto the cache. 
       
   290 	 * 
       
   291 	 * @param aParentSession RSessionBase handle to parent security manager session
       
   292 	 * @param aPolicyID TPolicyID policy identifier of the script associated with this script session
       
   293 	 * @param aExecID TExecutableID identifier of the script associated with this script session
       
   294 	 * @param aHashValue TDesC		hash value of the scrpt passed while registering the script
       
   295 	 * 
       
   296 	 * @return KErrNone if successful; In case of failure, one of system wide error cods
       
   297 	 */
       
   298 	TInt Open(const RSessionBase& aParentSession,TPolicyID aPolicyID,TExecutableID aExecID,const TDesC& aHashValue);
       
   299 
       
   300 	/**
       
   301 	 * Opens security manager script sub-session. This method in turn opens a
       
   302 	 * sub-session on the server side, by bringing script related data onto the cache. 
       
   303 	 * 
       
   304 	 * @param aParentSession RSessionBase handle to parent security manager session
       
   305 	 * @param aPolicyID TPolicyID policy identifier of the script associated with this script session
       
   306 	 * @param aExecID TExecutableID identifier of the script associated with this script session
       
   307 	 * @param aTrustInfo CTrustInfo trust data structure
       
   308 	 * 
       
   309 	 * @return KErrNone if successful; In case of failure, one of system wide error cods
       
   310 	 */
       
   311 	TInt Open(const RSessionBase& aParentSession,TPolicyID aPolicyID,TExecutableID aExecID,const CTrustInfo& aTrustInfo);
       
   312 
       
   313 	/**
       
   314 	 * Performs access permission check
       
   315 	 * 
       
   316 	 * This method evaluates access permission by comparing the expected capabilities
       
   317 	 * to perform service invocation with the capabilities of the script. The
       
   318 	 * capabilities of the script is computed as sum of :
       
   319 	 * 	
       
   320 	 * 	-	default allowed capabilities as specified in security access policy
       
   321 	 * 	-	user-granted capabilities, allowed by user while prompting
       
   322 	 *
       
   323 	 * The capabilities allowed by the user could be of various durations, like
       
   324 	 * session-based, blanket/permanent and the one valid for the current invocation only 
       
   325 	 * (one-shot)
       
   326 	 * 
       
   327 	 * @param aCapabilitiesToCheck RCapabilityArray list of capabilities to be checked against
       
   328 	 * script's capbilities
       
   329 	 * 
       
   330 	 * @return EAccessOk if the access permission check is successful; Else, EAccessNOk
       
   331 	 */
       
   332 	IMPORT_C TInt IsAllowed(const RCapabilityArray& aCapabilitiesToCheck);
       
   333 
       
   334 	/**
       
   335 	 * Performs access permission check
       
   336 	 * 
       
   337 	 * This overloaded method evaluates access permission by comparing the expected capabilities
       
   338 	 * to perform service invocation with the capabilities of the script. The
       
   339 	 * capabilities of the script is computed as sum of :
       
   340 	 * 	
       
   341 	 * 	-	default allowed capabilities as specified in security access policy
       
   342 	 * 	-	user-granted capabilities, allowed by user while prompting
       
   343 	 *
       
   344 	 * The capabilities allowed by the user could be of various durations, like
       
   345 	 * session-based, blanket/permanent and the one valid for the current invocation only 
       
   346 	 * (one-shot)
       
   347 	 * 
       
   348 	 * This overloaded version returns the list of capabilities that do not match after
       
   349 	 * access permission check. This can be used by the client to display to the user the
       
   350 	 * list of unmatched capabilities
       
   351 	 * 
       
   352 	 * @param aCapabilitiesToCheck RCapabilityArray list of capabilities to be checked against
       
   353 	 * script's capbilities
       
   354 	 * @param aUnMatchedCapabilities RCapabilityArray list of unmatched capabilities
       
   355 	 * 
       
   356 	 * @return EAccessOk if the access permission check is successful; Else, EAccessNOk
       
   357 	 */
       
   358 	IMPORT_C TInt IsAllowed(const RCapabilityArray& aCapabilitiesToCheck,RCapabilityArray& aUnMatchedCapabilities);
       
   359 
       
   360 	/**
       
   361      * Performs access permission check
       
   362      * 
       
   363      * This overloaded method evaluates access permission by comparing the expected capabilities
       
   364      * to perform service invocation with the capabilities of the script. The
       
   365      * capabilities of the script is computed as sum of :
       
   366      *  
       
   367      *  -   default allowed capabilities as specified in security access policy
       
   368      *  -   user-granted capabilities, allowed by user while prompting
       
   369      *
       
   370      * The capabilities allowed by the user could be of various durations, like
       
   371      * session-based, blanket/permanent and the one valid for the current invocation only 
       
   372      * (one-shot)
       
   373      * 
       
   374      * This overloaded version returns the list of capabilities that do not match after
       
   375      * access permission check. This can be used by the client to display to the user the
       
   376      * list of unmatched capabilities
       
   377      * 
       
   378      * @param aCapabilitiesToCheck RCapabilityArray list of capabilities to be checked against
       
   379      * script's capbilities
       
   380      * @param aProviderUid TProviderUid The provider that is being loaded
       
   381      * @param aResourceFilePath TFileName resource file containing the string to prompt.
       
   382      * 
       
   383      * @return EAccessOk if the access permission check is successful; Else, EAccessNOk
       
   384      */
       
   385 	IMPORT_C TInt IsAllowed(const RCapabilityArray& aCapabilitiesToCheck, TProviderUid aProviderUid, TFileName aResourceFileName);
       
   386 	
       
   387 	/**
       
   388      * Definition of default prompt handler.
       
   389      * 
       
   390      * @param aPromptDataList RPromptDataList list of prompt data used by
       
   391      * prompt callback handler to show to the user
       
   392      * 
       
   393      * @return KErrNone if prompting successful; In case of failure, one of
       
   394      * system wide error codes
       
   395      *
       
   396      */
       
   397 	TInt Prompt(RPromptDataList& aPromptDataList , TExecutableID aExecID = KAnonymousScript);
       
   398     
       
   399     /**
       
   400 	 * Definition of cost notification.
       
   401 	 * 
       
   402 	 */
       
   403     void PromptCostL() ; 
       
   404     
       
   405 	/**
       
   406 	 * Gets the underlying script object
       
   407 	 * 
       
   408 	 * This method is to be used by components, such as application manager,
       
   409 	 * that are interested in displaying script related information to the user.
       
   410 	 * 
       
   411 	 * Following are the script related information:
       
   412 	 * 
       
   413 	 * 	- Capabilities allowed by default
       
   414 	 * 	- User-grantable capabilities
       
   415 	 * 	- Currently allowed or denied blanket permissions
       
   416 	 *
       
   417 	 * Note that this method should not be used by runtimes unless and until there is
       
   418 	 * a strong design justification
       
   419 	 * 
       
   420 	 * @return a reference to underlying script object
       
   421 	 */
       
   422 	inline CScript& CRTSecMgrScriptSession::Script()
       
   423 		{
       
   424 		return *iScript;
       
   425 		}
       
   426 
       
   427 	/**
       
   428 	 * Returns prompt handler reference
       
   429 	 * 
       
   430 	 * @return reference to prompt handler
       
   431 	 */
       
   432 	inline MSecMgrPromptHandler* PromptHandler() const
       
   433 		{
       
   434 		return iPromptHdlr;
       
   435 		}
       
   436 
       
   437 	/**
       
   438 	 * Sets prompt UI option. The supported prompt options are :
       
   439 	 * 
       
   440 	 * 	-	Basic/Default
       
   441 	 * 	- 	Advanced
       
   442 	 * 
       
   443 	 * The difference between the basic and advanced prompt option
       
   444 	 * reisdes in the fact the number of prompt options and the corresponding
       
   445 	 * prompt texts displayed would be different.
       
   446 	 * 
       
   447 	 * If not explictly, the default prompt UI option is set to basic/default prompt UI.
       
   448 	 * 
       
   449 	 * @param aUIPromptOption TSecMgrPromptUIOption basic/advanced prompt UI option
       
   450 	 */
       
   451 	inline void SetPromptOption(TSecMgrPromptUIOption aUIPromptOption)
       
   452 		{
       
   453 		iUIPromptOption = aUIPromptOption;
       
   454 		}
       
   455 
       
   456 	/**
       
   457 	 * Gets prompt UI option. The supported prompt options are :
       
   458 	 * 
       
   459 	 * 	-	Basic/Default
       
   460 	 * 	- 	Advanced
       
   461 	 * 
       
   462 	 * The difference between the basic and advanced prompt option
       
   463 	 * reisdes in the fact the number of prompt options and the corresponding
       
   464 	 * prompt texts displayed would be different.
       
   465 	 * 
       
   466 	 * @return aUIPromptOption TSecMgrPromptUIOption basic/advanced prompt UI option
       
   467 	 */
       
   468 	inline TSecMgrPromptUIOption PromptOption() const
       
   469 		{
       
   470 		return iUIPromptOption;
       
   471 		}
       
   472 	
       
   473 	/**
       
   474 	 * Sets the application name to the value passed by the runtime.
       
   475 	 * The name is displayed as part of the prompt for provider based prompting.
       
   476 	 * If name is not set then the default name is used.
       
   477 	 * 
       
   478 	 * @param aName TDesC& name of the application.
       
   479 	 */
       
   480 	IMPORT_C void SetApplicationNameL(const TDesC& aName);
       
   481 	    
       
   482 
       
   483 private:
       
   484 	/*
       
   485 	 * Default private constructor
       
   486 	 * 
       
   487 	 */
       
   488 	CRTSecMgrScriptSession(MSecMgrPromptHandler* aPromptHdlr=0);
       
   489 
       
   490 	/*
       
   491 	 * Two phased constructor
       
   492 	 * 
       
   493 	 */
       
   494 	void ConstructL();
       
   495 
       
   496 	/*
       
   497 	 * Contains prompt logic
       
   498 	 * 
       
   499 	 */
       
   500 	TInt Prompt(CPromptData* aPromptData);
       
   501 	
       
   502 	/*
       
   503 	 * Private default implementation for advanced prompt UI option
       
   504 	 * 
       
   505 	 */
       
   506 	TInt PromptAdvanced(CPromptData* aPromptData);
       
   507 
       
   508 	/* 
       
   509 	 * Logic for displaying more inormation when the user selects more info
       
   510 	 * 
       
   511 	 */
       
   512 	TInt MoreInfoL(CPromptData& aPromptData);
       
   513 	
       
   514 	/*
       
   515 	 * Logic identifying the user-selection of prompt
       
   516 	 * duration
       
   517 	 * 
       
   518 	 */
       
   519 	void HandleGrantChosen(CPromptData* aPromptData,
       
   520 		TCapabilityBitSet aCapBitSet, TCapabilityBitSet& aAllowedCaps,
       
   521 		TBool& aIsPermGrantModified);
       
   522 
       
   523 	/*
       
   524 	 * Private implementation to update blanket permission data
       
   525 	 * 
       
   526 	 */
       
   527 	void UpdatePermGrant();
       
   528 	
       
   529 	/*
       
   530 	 * Conversion utility to convert a single 32-bit value to the list of
       
   531 	 * capabilities (RArray<TCapability>)
       
   532 	 * 
       
   533 	 */
       
   534 	void BuildCapsL(TCapabilityBitSet aCapBitSet, RCapabilityArray& aInOutTCapList);
       
   535 
       
   536 	/*
       
   537 	 * Private implementation to evaluate access permission check
       
   538 	 * 
       
   539 	 */
       
   540 	TInt IsAllowed(const RCapabilityArray& aCapsToCheck,RPromptDataList& aPromptDataList,TCapabilityBitSet& aUnMatchedCapBits);
       
   541 
       
   542 	/*
       
   543 	 * Private implementation to evaluate access permission check. This
       
   544 	 * overloaded version additionally returns the unmatched capabilities
       
   545 	 * 
       
   546 	 */
       
   547 	TInt IsAllowed(const RCapabilityArray& aCapsToCheck,TCapabilityBitSet& aUnMatchedCapBits);
       
   548 
       
   549 	/*
       
   550 	 * Conversion utility to generate an unsigned 32-bit value toggling the individual bits
       
   551 	 * to the corresponding TCapability value
       
   552 	 * 
       
   553 	 */
       
   554 	void AddCapability(TCapabilityBitSet& aInOutCapBitSet, TCapability aCapToSet);
       
   555 
       
   556 	/*
       
   557 	 * Attempts to close the script sub-session
       
   558 	 * 
       
   559 	 */
       
   560 	void Close();
       
   561 	
       
   562 	/*
       
   563 	 * Function to add the security manager resource file to the CONE environment
       
   564 	 */
       
   565 	void AddResourceFiles();
       
   566 	
       
   567 	/*
       
   568 	 * Function to add the provider's resource file from which the body of the prompt is populated.
       
   569 	 * 
       
   570 	 * @param aResourceFileName TFileName The resource file to be added to the CONE environment
       
   571 	 */
       
   572 	TInt AddProviderResourceFile(TFileName aResourceFileName);
       
   573 	
       
   574 	/*
       
   575 	 * Close all the resource files added to the CONE environment
       
   576 	 */
       
   577 	void CloseResourceFiles();
       
   578 
       
   579 private:
       
   580 	/*
       
   581 	 * permissions allowed or denied for the current session
       
   582 	 * The lifetime of this data structure is associated
       
   583 	 * with this script session
       
   584 	 * 
       
   585 	 */
       
   586 	struct
       
   587 		{
       
   588 		TSessionInfo* sessionInfo; //Information about what is allowed for this session (caps/providers allowed for this session & perm allowed)
       
   589 		TCapabilityBitSet DeniedCaps; //Information about what is denied for this session (caps/providers denied for this session & perm denied)
       
   590 		}_sessionData;
       
   591 
       
   592 	/*
       
   593 	 * anonymous enumerations for selection index
       
   594 	 * 
       
   595 	 */
       
   596 	enum
       
   597 		{
       
   598 		PROMPT_SELIDX_ZERO = 0,
       
   599 		PROMPT_SELIDX_ONE = PROMPT_SELIDX_ZERO + 1,
       
   600 		PROMPT_SELIDX_TWO = PROMPT_SELIDX_ZERO + 2,
       
   601 		PROMPT_SELIDX_THREE = PROMPT_SELIDX_ZERO + 3,
       
   602 		PROMPT_SELIDX_FOUR = PROMPT_SELIDX_ZERO + 4,
       
   603 		PROMPT_SELIDX_FIVE = PROMPT_SELIDX_ZERO + 5
       
   604 		};
       
   605 
       
   606 	/*
       
   607 	 * private script reference
       
   608 	 * 
       
   609 	 */
       
   610 	CScript* iScript;
       
   611 
       
   612 	/*
       
   613 	 * permanently allowed capability bits
       
   614 	 * 
       
   615 	 */
       
   616 	TPermanentInfo* _permanentInfo; //perm allowed information, persistently stored for this script
       
   617 
       
   618 	/*
       
   619 	 * Generic data about the script session
       
   620 	 * 
       
   621 	 */
       
   622 	HBufC* iSessionData; 
       
   623 	
       
   624 	/*
       
   625 	 * reference to prompt handler instance
       
   626 	 * 
       
   627 	 */
       
   628 	MSecMgrPromptHandler* iPromptHdlr;
       
   629 
       
   630 	/*
       
   631 	 * sub-session proxy pointer
       
   632 	 * 
       
   633 	 */
       
   634 	CRTSecMgrSubSessionProxy* iSubSessionProxy;
       
   635 
       
   636 	/*
       
   637 	 * pointer to Coe environment
       
   638 	 */
       
   639 	CCoeEnv* iCoeEnv;
       
   640 
       
   641 	/*
       
   642 	 * security manager resource file offset value
       
   643 	 * 
       
   644 	 */
       
   645 	RResourceArray iResourceOffsetArray;
       
   646 
       
   647 	/*
       
   648 	 * Prompt UI option
       
   649 	 * 
       
   650 	 */
       
   651 	TSecMgrPromptUIOption iUIPromptOption;
       
   652 	
       
   653 	/*
       
   654 	 * Custom prompt flag
       
   655 	 * 
       
   656 	 */
       
   657 	TBool isCustomPrompt;
       
   658 	};
       
   659 
       
   660 #endif //_CRTSECMGRSCRIPTSESSION_H_
       
   661