Pinned topic Write Access to Attribute
Do i need to check:
(isEdit or (isShare and LockedObject)) and PermissionToAttributeValue
or is there some function that checks everything?
llandale 270001QM9N2972 Posts
Re: Write Access to Attribute2013-02-11T20:23:04ZThis is the accepted answer. This is the accepted answer.
The "is it Edit or Shared-and-Locked and do I have rights to object and Attribute" method is complicated and subject to wierd exceptions.
The "canXX" perms determine if you have rights AND access right now and accurately predict what will happen:
if (!canModify(obj.NameAttr)) // then will fail else obj.NameAttr = Value
canModify, canControl, canDelete, canRead
You can also just trap the errors:
noError() obj.NameAttr = Value string ErrMess = lastError() if (!null ErrMess) // then write error else success
That is a little better since the first method actually requires you to trap "obj.NameAttr" reference errors.
-LouieUpdated on 2014-01-06T13:30:06Z at 2014-01-06T13:30:06Z by iron-man