Due to recent updates, all users are required to create an Altair One account to login to the RapidMiner community. Click the Register button to create your account using the same email that you have previously used to login to the RapidMiner community. This will ensure that any previously created content will be synced to your Altair One account. Once you login, you will be asked to provide a username that identifies you to other Community users. Email us at Community with questions.

Macro for Logged in User

JEdwardJEdward RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 578 Unicorn
edited November 2018 in Help
Hi guys,

I want to set a macro based on the currently logged in username. 
For example if I'm wanting to run a process that loops through the repository of that specific user how would I get the value of that logged in user to use in the process? 
Another option might be if I have a database connection which changes based on the logged in user so that there is an audit trail of any queries or changes that user has made in the SQL logs. 

I'm sure it's just something like %{user}, but could do with confirming. 
Tagged:

Answers

  • Marco_BoeckMarco_Boeck Administrator, Moderator, Employee, Member, University Professor Posts: 1,996 RM Engineering
    Hi,

    the macro is called "_ra_user".

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <process version="7.2.000-SNAPSHOT">
      <context>
        <input/>
        <output/>
        <macros/>
      </context>
      <operator activated="true" class="process" compatibility="7.2.000-SNAPSHOT" expanded="true" name="Process">
        <process expanded="true">
          <operator activated="true" class="generate_data_user_specification" compatibility="7.2.000-SNAPSHOT" expanded="true" height="68" name="Generate Data by User Specification" width="90" x="45" y="34">
            <list key="attribute_values">
              <parameter key="Test" value="%{_ra_user}"/>
            </list>
            <list key="set_additional_roles"/>
          </operator>
          <operator activated="true" class="store" compatibility="7.2.000-SNAPSHOT" expanded="true" height="68" name="Store" width="90" x="179" y="34">
            <parameter key="repository_entry" value="UserLoggedInTest"/>
          </operator>
          <connect from_op="Generate Data by User Specification" from_port="output" to_op="Store" to_port="input"/>
          <portSpacing port="source_input 1" spacing="0"/>
          <portSpacing port="sink_result 1" spacing="0"/>
        </process>
      </operator>
    </process>
    Regards,
    Marco
  • JEdwardJEdward RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 578 Unicorn
    Thanks Marco! 

    My newest evil plan is to combine this with Single Sign On integration to customize entire analytic web apps based on the logged in user. 
    Using this I'll easily be able to build apps that can be customized even down to the data, imagery & CSS of the app.  Cheers! 
Sign In or Register to comment.