Wrapper on Item Planning Maintenance

rmdasari

Member
Hi All :

We had a wrapper written on Item Planning Maintenance program to restrict users not belonging to a certain group (User Group) not to update Supplier field (ptp_vend). The program works fine when the user not belonging to that User group try to enter / modify the data, but if he does a lookup (pressing "F2" function key), he was able to update the field.

Any help as how I could restrict the user not to update from the lookup will be greatly appreciated.

Find below the code snippet :

if self:name = "ptp_vend" then do:
find first code_mstr no-lock where
/*PICSDCONV*/ code_mstr.code_domain = global_domain and
code_fldname = "pm_secure"
no-error.
if available code_mstr then do:
find usr_mstr no-lock where usr_userid = global_userid
no-error.
if available usr_mstr then do:
g-list = ''.
for each usrgd_det no-lock where usrgd_userid = global_userid,
each usrg_mstr no-lock where
usrg_mstr.oid_usrg_mstr = usrgd_det.oid_usrg_mstr:
if length(g-list) > 0
then g-list = g-list + "," + usrg_group_name.
else g-list = usrg_group_name.
end.
if lookup(code_value,g-list) = 0 then do:
message "ERROR: Access to this field denied."
self:screen-value = a-vend.
end.


Regards,

Ramamurthy Dasari
 

rmdasari

Member
Hi Robles :

Unfortunately it didn't work. Still I can do a "F2" and select a new value.


Regards,

Ramamurthy Dasari
 

RealHeavyDude

Well-Known Member
Just curious - is the field enabled?

If I were you I would net enable the field at all if the user does not have access privilege to it. This will make sure the user can't do anything and you don't need to take care any further in the user interface. Furthermore, I would also check the security restrictions in the business logic if it's not called from the UI to make sure security settings are applied.

Regards, RealHeavyDude.
 
Top