Skip to main content

I've designed a form to be used by a set of users, where numerous buttons / actions / rules are defined.


Now, I'm looking to produce a read-only version of this exact same form.  I created another state, and able to alter the Initialize rule for this second state (titled "read-only") to not allow interaction.  Seems to work in that the read-only state has buttons hidden, and all double click events are disabled... while keeping things the same on the "standard" state.


Final step is to bind which user accounts will be taken to which state.   Most users should go to full interactive state.. but I need other set of users to be taken to another state (the read only)


How can I configure a rule that during initialize (??)  when the user is X, then use state "standard" and if user is Y, then use state "read-only"?


*side note.. Would like to put the logged in user value on my form too.. just in a text box for knowing "who's logged in."..   but again.. cannot seem to find current user in the smart forms context menu.  How do you write smart form rules / full value from the current user?


This is with the newest K2 smart forms.. and there is no workflow at play yet.  Workflows are started from actions ON THIS form. (and thus the reason why I need a read only version.. so that some people do not trigger these workflows).


Thanks,


Scott G

Could you not write a smart object that will take in the user name and compare that to your list of people that should see the editable list and return a bool, then have a form that they open before this one that executes that method, and depending on the outcome redirects them to the desired form/state combination?


Hm.  Thanks for the suggestion.


Indeed... I suppose I can make some front end from (launch form).. and use initialize rules to determine a reaction to "navigate to form".... when true state A... when false State B.


But.. then my logic for user names is just string comparisons?  I sort of expect a way to define some list of users (official Active Directory user accounts... or K2 Logins).. and truly define permission to reach a form.


With this solution.. the difference is just the state of the form.  The form state parameter is included in the URL...and there really is nothing preventing a "restricted" user from access the "writable" flavor... if they can discover the URL.


No truly permission assignment with form state.. (User X has permission / not have permission to load a said form)?


Scott G


In the context browser, you have a section called "System Values" underneath that, you can drag in the current user values. You can pass in the state value as a url parameter


I've seen that "System Values" context menu show up when during some "Advanced Rules".


.. but I want to push that value to an on-screen control. (i.e.. a text box.. or some label.)


I thought to move data from some context to the "Text value" of a control.. you perform that via a "Data Transfer."  And .. from the Data Transfer action... System Values is not available.. only smart object values are reachable.


Must be missing something.  ?


Are you using the latest version 1.0.3. I can see the values and drag them. I have a rule like this: When the view executed Initialize...transfer data


Reply