Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
2 replies Latest Post - ‏2013-02-12T07:41:23Z by SystemAdmin
SystemAdmin
SystemAdmin
3180 Posts
ACCEPTED ANSWER

Pinned topic Write Access to Attribute

‏2013-02-11T16:11:02Z |
What is the simplest way to determine if it is possible to write to an attribute?

Do i need to check:
(isEdit or (isShare and LockedObject)) and PermissionToAttributeValue

or is there some function that checks everything?
Updated on 2013-02-12T07:41:23Z at 2013-02-12T07:41:23Z by SystemAdmin
  • llandale
    llandale
    2943 Posts
    ACCEPTED ANSWER

    Re: Write Access to Attribute

    ‏2013-02-11T20:23:04Z  in response to SystemAdmin

    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.

    -Louie

     

    Updated on 2014-01-06T13:30:06Z at 2014-01-06T13:30:06Z by iron-man
    • SystemAdmin
      SystemAdmin
      3180 Posts
      ACCEPTED ANSWER

      Re: Write Access to Attribute

      ‏2013-02-12T07:41:23Z  in response to llandale
      Ah yes, the 'can..s' were what I was looking for.

      Thanks Louie