2 Replies Latest reply on Jan 15, 2013 3:17 PM by Bayani Portier

    How to go about changing settings based upon logged in user

    Bayani Portier Level 1

      Hi all,

       

      I'm wondering if anyone has any thoughts on how one would go about changing a property on a node based upon the logged in user.

       

      For example, say you have a path property at /apps/myComponent/settings.path=/content/dam/genericfolder that for an author have the value of /apps/myComponent/settings.path=/content/dam/sandbox, and for an approver have the value of /apps/myComponent/settings.path=/content/dam/approvalsandbox

        • 1. Re: How to go about changing settings based upon logged in user
          Ove Lindström Level 4

          Hi,

           

          store it in the User-node. That node is no different from any other node.

           

          But, if I get your intention right, you are going to move Assets between different paths depending on their state. IMHO, that is a bad way of doing it.

           

          I would create different roles, as you have done, and then use properties that tells what state an asset has. Then you can grab the current users role in the component and match the role with the state.

          1 person found this helpful
          • 2. Re: How to go about changing settings based upon logged in user
            Bayani Portier Level 1

            Hi Ove,

             

            Thanks for the tip on the user role. I had thought about taking that approach, however, leveraging the user role and properties associated with it would be the correct approach if writing custom components. What I am looking for is a way to take existing components, and essentially use them in context of the user.

             

            For example, say if you are trying to give a sub group of users access to a subset of the DAM directory, and you don't particularly wish to hack around the existing WCM DAM component, there is a setting in the tree navigator (/libs/wcm/core/content/damadmin/treeRoot) that lets you specify where the root of the tree is. (There are more settings to work with, but this is just one used to illustrate.)

             

            If you can change the property based upon the user, that gives you the functionality without altering code.

             

            I would like to know if this is possible, if this is an inherently bad practice, if so why, and whether there may be another alternative out there which lets you avoid having to alter the code of an existing component.

             

            Thanks again for answering.