i have gone over my code several times and i cant figure out why its not giving me the correct access mask for a folder.
IntPtr dynBuffer = PWWrappers.aaApi_SelectAccessControlDataBuffer(PWConstants.AADMSFOAF_IGNORE_USERSETTINGS, PWConstants.AADMSAOTYPE_PROJECT, FolderID, 0, 0, 0, 0); int countofdynBuffer = PWWrappers.aaApi_DmsDataBufferGetCount(dynBuffer); for (int y = 0; y < countofdynBuffer; y++) { int AcceMask = PWWrappers.aaApi_DmsDataBufferGetNumericProperty(dynBuffer, PWConstants.ACCE_PROP_ACCEMASK, y); //see if AcceMask has edit access PWConstants.AccessRightsFlags curFlags = (PWConstants.AccessRightsFlags)AcceMask; if (curFlags.HasFlag(PWConstants.AccessRightsFlags.AADMS_ACCESS_FWRITE)) {//has file write access } else { } } //free buffer PWWrappers.aaApi_DmsDataBufferFree(dynBuffer);
im trying to check which user lists have file write access to a folder. so i loop the buffer and check the access mask but its not returning the correct results when i compare to PW explorer.
note that the folder im checking does not have a workflow assigned.
i have triple checked that i have the correct folder.
the code above gives me the 2LMN user list access mask as 382 (default flag) but then for the Carpenter-Marty user list I get 102 as the access mask (Write, read, create, and delete)
but you can see from the screen shot that both user lists have the same access control.
its like for the carpenter-marty user list its only giving me the folder security and not the document security on the folder but then the 2LMN user list access mask gives me both folder and document security. what am i missing??? this is driving me nuts.
well i think i figured it out.
i changed the buffer from AADMSAOTYPE_PROJECT to AADMSAOTPYE_DOCUMENT and then it gave me the document security on the folder.
i don't get why for the 2LMN user list i was getting both folder and document security in my access mask....i feel like it should not have given me the document security but it did, which let to my confusion.
Answer Verified By: John Drsek