This may help U.
if (hasSecurityKeyAccess(securitykeyNum(mySecurityKey),
AccessType::View))
{
//code requiring authorization goes here...
}
if (hasMenuItemAccess(menuItemDisplayStr(myMenuItem),
MenuItemType::Display)))
{
//code requiring authorization goes here...
}
DictTable dictTable = new DictTable(tablenum(myTable));
if (dictTable.rights >= AccessType::Insert))
{
//code requiring authorization goes here...
}
if
(isConfigurationkeyEnabled(configurationkeyNum(myConfigKey)
)
{
//code requiring authorization goes here...
}





________________________________
From: srinath s <s_shreen...@yahoo.co.in>
To: development-axapta@yahoogroups.com
Sent: Fri, July 9, 2010 3:15:53 PM
Subject: [development-axapta] How to know the user has access to purchase order 
using code

  


Hi champs,
In order to restrict the user to use the purchase order I am giving no access 
permission to the user that belongs to the user group say “xyz”. Will select 
the 
user group xyz in the user group form and will go to the permission tab and 
select the security key in the drop down of the View field. In the tree 
structure AP -> Tables (full control)->Purchase orders and made it as No 
access. 

After the above setting I re-launched the AX for that particular user, it’s not 
allowing to open the purchase order form which is expected behaviour.
Now through code how can I check the user has access to purchase order. Using 
hassecuritykeyaccess method I can pass the securitykey but which security key 
to 
pass is my confusion. Because the security key attached to the purchtable 
 menuitem is “VendMisc”(Miscellaneous node in permission form tree structure AP 
-> Miscellaneous) and security key attached to the purchtable table is 
“VendTables” (Tables node in permission form tree structure AP->Tables).
Could anybody help me on this.
Regards,
Srinath. S

 
 
 

[Non-text portions of this message have been removed]


 


      

[Non-text portions of this message have been removed]

Reply via email to