The following API code will allow you to determine what permission the connected user has on a selected object:-
/* 1. Obtain the object id for the selected document */
getdata,c,dcapp,selected
/* 2. Find the what permission the connected user has on this object */
get,c,<object id found in step 1>,_permit
This returns an integer number which defines the permit level assigned to a customer
below are the numbers returned together with the corresponding permission level:-
0 Indicates object is not a dmSysobject (or a sub type of dm_sysobject)
1 Indicates Connected user has NO permissions on the object
2 Indicates connected user has BROWSE permission on the object
3 Indicates connected user had READ permisiion on the object
4 Indicates connected user has RELATE premission on the object
5 Indicates conncted user has VERSION permission on the object
6 Indicates connected user has WRITE permission on the object
7 Indicates connected user has DELETE permission on the object