How to check whether we do have access to create and delete link using DXL?

Hello,

 How to write DXL code to check whether we do have access to create and delete a link using DXL?

Thank you


Mayur Chaudhari - Fri Jan 12 09:18:58 EST 2018

Re: How to check whether we do have access to create and delete link using DXL?
XiaoXingLu - Mon Jan 15 22:04:11 EST 2018

Hi Mayur,

 

I think you can use below function to determine if the user can delete the link:

bool canDelete(Link l)
string canDelete(Link l)

 

if you wanna check if the user can create the link, the user must have modify access to the source object and read access to the target object of the link. So the function AccessRec get(...) should be the one you can use. You can refer to the dxl manual: https://www.ibm.com/support/knowledgecenter/SSYQBZ_9.6.1/com.ibm.doors.requirements.doc/topics/dxl_reference_manual.pdf.

Re: How to check whether we do have access to create and delete link using DXL?
PekkaMakinen - Tue Jan 16 01:18:49 EST 2018

XiaoXingLu - Mon Jan 15 22:04:11 EST 2018

Hi Mayur,

 

I think you can use below function to determine if the user can delete the link:

bool canDelete(Link l)
string canDelete(Link l)

 

if you wanna check if the user can create the link, the user must have modify access to the source object and read access to the target object of the link. So the function AccessRec get(...) should be the one you can use. You can refer to the dxl manual: https://www.ibm.com/support/knowledgecenter/SSYQBZ_9.6.1/com.ibm.doors.requirements.doc/topics/dxl_reference_manual.pdf.

To create a link also the source module should be included in link module descriptors in the folder, if link module descriptors are in use

"A folder or project can specify the link modules to be used when a link is created between a pair of modules, the source of which is in the folder. This source/target module pairing is called a link module descriptor, which is represented by the LinkModuleDescriptor data type. 

Note: To obtain a type LinkModuleDescriptor handle, you must use the for link module descriptor in folder loop. "

Re: How to check whether we do have access to create and delete link using DXL?
Mike.Scharnow - Tue Jan 16 05:11:05 EST 2018

PekkaMakinen - Tue Jan 16 01:18:49 EST 2018

To create a link also the source module should be included in link module descriptors in the folder, if link module descriptors are in use

"A folder or project can specify the link modules to be used when a link is created between a pair of modules, the source of which is in the folder. This source/target module pairing is called a link module descriptor, which is represented by the LinkModuleDescriptor data type. 

Note: To obtain a type LinkModuleDescriptor handle, you must use the for link module descriptor in folder loop. "

And in  case no link exists yet between current module and destination module, it needs to be determined if the link module exists, if it already has a corresponding link set object, if not, whether the user has modify access to the link module...... 

 

Mayur, Perhaps it is the easiest if you just try to create the link and afterwards see whether the link exists...