GetAuthorizedTasks Method
For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.
Constructs and returns a data set that describes the tasks that the current user is authorized to perform using the Marketing System objects.
Namespace: Microsoft.CommerceServer.Marketing
Assembly: Microsoft.CommerceServer.Marketing.CrossTierTypes (in Microsoft.CommerceServer.Marketing.CrossTierTypes.dll)
Syntax
'Declaration
Public Function GetAuthorizedTasks As DataSet
'Usage
Dim instance As MarketingContext
Dim returnValue As DataSet
returnValue = instance.GetAuthorizedTasks()
public DataSet GetAuthorizedTasks()
public:
DataSet^ GetAuthorizedTasks()
public function GetAuthorizedTasks() : DataSet
Return Value
Type: System.Data..::.DataSet
A DataSet containing two DataTables named "Scopes" and "Tasks" respectively. See the remarks section for details on the format of the DataSet.
Exceptions
Exception | Condition |
---|---|
AuthorizationPolicyRequiredException | The MarketingContext was initialized without Authorization enabled. |
Remarks
GetAuthorizedTasks requires the MarketingContext object or Web service to be initialized against a valid authorization policy. If the AuthorizationMode used to initialize the MarketingContext is NoAuthorization, then an AuthorizationPolicyRequiredException exception is raised.
The returned DataSet contains two DataTables: "Scopes" and "Tasks". The information in these DataTables is read from the authorization policy and is configurable using the Authorization Manager MMC tool.
The "Scopes" table contains the following columns, which are read from the policy and do not depend on the current user:
Column Name |
Value |
---|---|
Name |
The Name of the authorization Scope. The well-defined name "Application" denotes the top-level Application scope. |
Description |
The Description of the authorization scope. |
Category |
This value is nullNothingnullptra null reference (Nothing in Visual Basic) for the top-level Application scope. For other scopes, the value is taken from the ApplicationData property of the scope as read from the authorization policy. The marketing system uses scopes only for campaign items. So in a normal configuration this value should either be nullNothingnullptra null reference (Nothing in Visual Basic) or contain the string "CampaignItemType". |
The "Tasks" table contains the following columns, which are user-dependent:
Column Name |
Value |
---|---|
Task |
The name of a task for which the current user is authorized. |
Scope |
The name of the scope in which this task is authorized. The well-defined scope name Application refers to the top-level scope. The user may be authorized to perform the same task in multiple scopes. |
Permissions
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.