Skip to main content
1-Visitor
August 29, 2012
Question

Need ACL help

  • August 29, 2012
  • 3 replies
  • 936 views
Adepters:

We use XIncludes extensively. Normally, even if you have write access to an XIncluded object, you can't make changes until you lock the entity. That happens automatically if you click inside the object. However, we have a couple of macros that we use to globally find and then replace a certain attribute (which get invoked by function keys):

<macro name="findChangeStatus">
<desc>Finds next changeStatus attribute</desc>
<script type="application/x-acl"></script>
</macro>
<macro name="deleteChangeStatus">
<desc>Finds next changeStatus attribute and deletes</desc>
<script type="application/x-acl"> oid_delete_attr(oid_current_tag(), "changeStatus");]]></script>
</macro>

Unfortunately, these don't cause the entity to be locked, so the deleteChangeStatus doesn't work. I found an ACL function, "oid_entity_lock", which would seem to be what I need. But, not being an accomplished ACL programmer, I can't figure out how to incorporate that into my "deleteChangeStatus" macro.

Can anyone help?

Dave Hintz
Siemens

    3 replies

    1-Visitor
    August 29, 2012
    I don't play with macros or entities, but I would try modifying the second
    macro to be:

    <macro name="deleteChangeStatus">
    <desc>Finds next changeStatus attribute and deletes</desc>
    <script type="application/x-acl"> #ModifyAttributes;
    oid_entity_lock(oid_current_tag());
    oid_delete_attr(oid_current_tag(), "changeStatus");
    ]]>
    </script>
    </macro>

    The desc should probably be updated to:
    Locks entity and deletes changeStatus attribute.

    If oid_current_tag() returns a non-entity oid then oid_entity_lock() will
    fail ... how gracefully, I don't know, but from reading the help on it,
    there's hope it won't throw a user-distracting error.


    1-Visitor
    August 29, 2012
    I had actually tried that, but apparently had something wrong with the syntax. Your example worked perfectly!

    Thanks!
    Dave
    1-Visitor
    August 29, 2012
    super! glad to help.