C# Class Microsoft.Protocols.TestSuites.MS_OXCPERM.MS_OXCPERMAdapter

Implementation of the MS-OXCPERM adapter.
Inheritance: Microsoft.Protocols.TestTools.ManagedAdapterBase, IMS_OXCPERMAdapter
Show file Open project: OfficeDev/Interop-TestSuites

Public Methods

Method Description
AddPermission ( FolderTypeEnum folderType, string permissionUserName, RequestBufferFlags requestBufferFlags, List permissionList ) : uint

Add a permission for a user to the permission list of the folder

CheckPidTagMemberRightsBehavior ( PermissionTypeEnum permission, string userName ) : uint

Check whether the user has the permission to operate the corresponding behavior specified by permission.

CheckRopQueryRowsErrorCodeAccessDenied ( FolderTypeEnum folderType, string permissionUserName, List permissionList ) : uint

Check the error code AccessDenied when calling RopQueryRows ROP.

CreateMessageByLogonUser ( ) : uint

Create a new message in the mail box folder of the user configured by "AdminUserName" by the logon user.

Disconnect ( ) : bool

Disconnect the connection with server.

GetPermission ( FolderTypeEnum folderType, string permissionUserName, RequestBufferFlags requestBufferFlags, List &permissionList ) : uint

Get the permission list for a user on the folder

Initialize ( ITestSite testSite ) : void

Initialize the adapter.

InitializePermissionList ( ) : void

Initialize the permission list.

Logon ( string userName ) : void

The user connects to the server and logons to the mailbox of the user configured by "AdminUserName" in ptfconfig.

ModifyPermission ( FolderTypeEnum folderType, string permissionUserName, RequestBufferFlags requestBufferFlags, List permissionList ) : uint

Modify the permission list for a user on the folder

ReadSecurityDescriptorProperty ( FolderTypeEnum folderType ) : uint

Read the folder's PidTagSecurityDescriptorAsXml property. For more details see section 3.1.4.1 Retrieving Folder Permissions of [MS-OXCPERM]

RemovePermission ( FolderTypeEnum folderType, string permissionUserName, RequestBufferFlags requestBufferFlags ) : uint

Remove a permission for a user from the permission list on the folder

Reset ( ) : void

Revert the permissions list.

Private Methods

Method Description
CheckFolderVisible ( ) : uint

Check whether the user can open the Inbox folder and see the hierarchy table of Inbox.

CheckUserPermissionContained ( string user, List permissionsList ) : bool

Check the permissions list contains the user's permissions.

CreateEntryIdProperty ( string permissionUserName ) : TaggedPropertyValue

Create the TaggedProperty structure for PidTagEntryId property.

CreateGetHierarchyTableRequestBuffer ( ) : RopGetHierarchyTableRequest

Create buffer for get hierarchy table.

CreateGetPermissionsTableRequestBuffer ( FolderTypeEnum folderType ) : RopGetPermissionsTableRequest

Create request to get permissions table

CreateGetPermissionsTableRequestBuffer ( RequestBufferFlags requestBufferFlags ) : RopGetPermissionsTableRequest

Create buffer to get PermissionsTable

CreateHierarchyTablePropertyTagsForFolder ( ) : Microsoft.Protocols.TestSuites.Common.PropertyTag[]

Create the PropertyTag sent to set column for GetHierarchyTable

CreateHierarchyTablePropertyTagsForPermissionUser ( ) : Microsoft.Protocols.TestSuites.Common.PropertyTag[]

Create the PropertyTag sent to set column for GetHierarchyTable

CreateMemberIdProperty ( ulong pidTagMemberId ) : TaggedPropertyValue

Create the TaggedProperty structure for PidTagMemberId property.

CreateModifyPermissionsRequestBuffer ( PermissionData permissionsDataArray, RequestBufferFlags requestBufferFlags ) : RopModifyPermissionsRequest

Create buffer to get ModifyPermissions

CreateOpenFolderRequestBuffer ( ulong folderId ) : RopOpenFolderRequest

Create buffer for open folder.

CreateOpenStreamRequestBuffer ( ) : RopOpenStreamRequest

Create request to open stream

CreateQueryRowsRequestBuffer ( ) : RopQueryRowsRequest

Create buffer for query rows.

CreateRightsProperty ( uint memberRights ) : TaggedPropertyValue

Create the TaggedProperty structure for PidTagMemberRights property.

CreateSetColumnsRequestBuffer ( PropertyTag propertyTags ) : RopSetColumnsRequest

Create buffer for set columns.

CreateSubFolder ( string user ) : uint

Create a sub-folder in the Inbox folder.

DeleteMessage ( ulong messageId ) : uint

Delete the message created by the owner of the mailbox or other user in Inbox.

DoRopCall ( ISerializable ropRequest, uint inobjHandle, object &response, byte &rawData ) : List>

Process and send ROP request.

EditMessage ( ulong messageId ) : uint

Edit the message created by the owner of the mailbox or other user in Inbox.

GetCalendarFolderId ( ) : ulong

Get the calendar folder id.

GetEntryId ( string permissionUserName ) : byte[]

Get EntryId by user name.

GetFolderObjectHandle ( FolderTypeEnum folder ) : uint

Get Folder Object Handle

GetMemberIDs ( List permissionUserList ) : List

Get the PidTagMemberId values for all users

GetMemberIdByName ( string permissionName, List permissionUserList ) : ulong

Get member id by member name

GetMemberRights ( List permissionUserList ) : List

Return the MemberRights

GetPidTagMemberId ( List permissionUserList, string permissionUserName, bool &memberIdIsExisted ) : ulong

Get the PidTagMemberId by searching the List

GetRightsByByteArray ( byte &byteRights ) : uint

Get the permissionRight by the Byte Array

GetUserPassword ( string user ) : string

Get the user's password.

ModifyFolderProperty ( ) : uint

Modify the folder permissions to check the folder permissions can be changed.

ParsePermissionByUserNameFromUserInfoList ( string permissionUserName, List &permissionList, List &permissionUserList ) : uint

Get special user rights

ParsePermissionFromPermissionTypeListToByteFormat ( List permissionList ) : uint

Create the permissionRight by the PermissionList

ParseRightsFromByteToPermissionList ( List &permissionList, uint rights ) : void

Get right list from rights mask

ParseUserListFromRawData ( List &permissionUserList, byte &rawData ) : bool

Parse the values from server

QueryPermission ( FolderTypeEnum folderType, uint &folderHandle, List &permissionUserList ) : void

Get the permission data.

QueryRowParse ( PropertyTag propertyTags, byte rawData ) : List>

Parse the return rawData from the QueryRow

ROPLogon ( LogonType logonType, string userDN, uint &objHandle ) : RopLogonResponse

Logon onto the Exchange server.

ReadMessage ( ulong messageId ) : uint

Read a message in the mail box folder according to the message Id.

RegisterForParses ( int propertyId, IPropertyInterface testClass ) : void

Register a property's ID together with a structure

RegisterToParses ( ) : void

Register the properties to parse

ReleaseObject ( uint objectHandle ) : void

Call RopRelease ROP to release the object.

RetrievePermissionsList ( FolderTypeEnum folderType, uint folderHandle, RequestBufferFlags requestBufferFlags ) : uint

Retrieve the permission list for a user of the folder

SetPermissionDataArrayForAdd ( string permissionUserName, uint memberRights ) : Microsoft.Protocols.TestSuites.Common.PermissionData[]

Set the permissionData array for adding by the permissionUserName and permissionRight

SetPermissionDataArrayForModify ( ulong pidTagMemberId, uint memberRights ) : Microsoft.Protocols.TestSuites.Common.PermissionData[]

Set the permissionData array for modifying by the PidTagMemberId and PidTagMemberRights.

SetPermissionDataArrayForRemove ( ulong pidTagMemberId ) : Microsoft.Protocols.TestSuites.Common.PermissionData[]

Set the permissionData array for removing by the PidTagMemberId

VerifyCreateFlagValue ( ) : void

Verify the Create flag value

VerifyCreateSubFolderFlagValue ( ) : void

Verify the CreateSubFolder flag value

VerifyCredential ( string user, string password, uint logonReturnValue ) : void

Verify the credential is provided to log on the server.

VerifyDeleteAnyFlagValue ( ) : void

Verify the DeleteAny flag value

VerifyDeleteOwnedFlagValue ( ) : void

Verify the DeleteOwned flag value

VerifyEditAnyFlagValue ( ) : void

Verify the EditAny flag value

VerifyEditOwnedFlagValue ( ) : void

Verify the EditOwned flag value

VerifyFolderOwnerFlagValue ( ) : void

Verify the FolderOwner flag value

VerifyFolderVisibleFlagValue ( ) : void

Verify the FolderVisible flag value

VerifyFreeBusyDetailedFlagValue ( ) : void

Verify the FreeBusyDetailed flag value

VerifyFreeBusySimpleFlagValue ( ) : void

Verify the FreeBusySimple flag value

VerifyGetPermissionHandle ( uint responseValue ) : void

Verify the server object handle to a Table object

VerifyMAPITransport ( ) : void

Verify MAPIHTTP transport.

VerifyMessageSyntax ( ) : void

Verify the message syntax.

VerifyModifyPermissionsResponse ( ) : void

Verify the RopModifyPermissions ROP response buffer

VerifyProperties ( bool succeedToParse, List permissionUserList ) : void

Verify properties' value

VerifyPropertiesOfDataStructure ( bool succeedToParse, List permissionUserList ) : void

Capture Requirements related to the data structures for the MS-OXCPERM

VerifyReadAnyFlagValue ( ) : void

Verify the ReadAny flag value

VerifyReturnValueForGetPermission ( ) : void

Verify the return value is 4 bytes.

VerifyReturnValueForModifyPermission ( ) : void

Verify the return value is 4 bytes.

VerifyReturnValueSuccessForGetPermission ( uint returnValue ) : void

Verify the return value when calling RopGetPermissionsTable is successful.

VerifyReturnValueSuccessForModifyPermission ( uint returnValue ) : void

Verify the return value when calling RopModifyPermissions is successful.

Method Details

AddPermission() public method

Add a permission for a user to the permission list of the folder
public AddPermission ( FolderTypeEnum folderType, string permissionUserName, RequestBufferFlags requestBufferFlags, List permissionList ) : uint
folderType FolderTypeEnum Folder type
permissionUserName string The user whose permission is added. The user name is the alias of the user without domain
requestBufferFlags RequestBufferFlags Request buffer flags
permissionList List The permission list of the folder specified by folderType
return uint

CheckPidTagMemberRightsBehavior() public method

Check whether the user has the permission to operate the corresponding behavior specified by permission.
public CheckPidTagMemberRightsBehavior ( PermissionTypeEnum permission, string userName ) : uint
permission PermissionTypeEnum The permission flag specified in PidTagMemberRights
userName string The user whose permission is specified in permission argument.
return uint

CheckRopQueryRowsErrorCodeAccessDenied() public method

Check the error code AccessDenied when calling RopQueryRows ROP.
public CheckRopQueryRowsErrorCodeAccessDenied ( FolderTypeEnum folderType, string permissionUserName, List permissionList ) : uint
folderType FolderTypeEnum Folder type
permissionUserName string The permission user name
permissionList List The permission list of the folder specified by folderType
return uint

CreateMessageByLogonUser() public method

Create a new message in the mail box folder of the user configured by "AdminUserName" by the logon user.
public CreateMessageByLogonUser ( ) : uint
return uint

Disconnect() public method

Disconnect the connection with server.
public Disconnect ( ) : bool
return bool

GetPermission() public method

Get the permission list for a user on the folder
public GetPermission ( FolderTypeEnum folderType, string permissionUserName, RequestBufferFlags requestBufferFlags, List &permissionList ) : uint
folderType FolderTypeEnum Folder type
permissionUserName string The user whose permission is returned. The user name is the alias of the user without domain
requestBufferFlags RequestBufferFlags The TableFlags or the ModifyFlags
permissionList List The permission list of the folder specified by folderType
return uint

Initialize() public method

Initialize the adapter.
public Initialize ( ITestSite testSite ) : void
testSite ITestSite Test site.
return void

InitializePermissionList() public method

Initialize the permission list.
public InitializePermissionList ( ) : void
return void

Logon() public method

The user connects to the server and logons to the mailbox of the user configured by "AdminUserName" in ptfconfig.
public Logon ( string userName ) : void
userName string The user to logon to the mailbox of the user configured by "AdminUserName" in ptfconfig
return void

ModifyPermission() public method

Modify the permission list for a user on the folder
public ModifyPermission ( FolderTypeEnum folderType, string permissionUserName, RequestBufferFlags requestBufferFlags, List permissionList ) : uint
folderType FolderTypeEnum Folder type
permissionUserName string The user whose permission is modified. The user name is the alias of the user without domain
requestBufferFlags RequestBufferFlags Request buffer flags
permissionList List The permission list of the folder specified by folderType
return uint

ReadSecurityDescriptorProperty() public method

Read the folder's PidTagSecurityDescriptorAsXml property. For more details see section 3.1.4.1 Retrieving Folder Permissions of [MS-OXCPERM]
public ReadSecurityDescriptorProperty ( FolderTypeEnum folderType ) : uint
folderType FolderTypeEnum The folder type specifies the PidTagSecurityDescriptorAsXml property of the folder is read.
return uint

RemovePermission() public method

Remove a permission for a user from the permission list on the folder
public RemovePermission ( FolderTypeEnum folderType, string permissionUserName, RequestBufferFlags requestBufferFlags ) : uint
folderType FolderTypeEnum Folder type
permissionUserName string The user is removed from the permissions list. The user name is the alias of the user without domain
requestBufferFlags RequestBufferFlags Request buffer flags
return uint

Reset() public method

Revert the permissions list.
public Reset ( ) : void
return void