Variables - Write and Create role...

rburgering
Kilo Contributor

Hi,

When ordering services, we want to pass some variables that are not to be filled by the requestor (i.e. the orderguide name or the requested_for, they are filled via the default value script on the variable). These values are available on the form, but should not be edited. For this, we put the admin role on the 'create' role. This makes the variable read only for almost everyone. The 'write' role is reserved for the catalog_admin, nobody should update variables after submit.

Now the following happens: the variables that have the 'create' role set to be 'admin' do not show up in the Request Item record or the Task. They are not in the variable editor......
Is there any way around this? A genuine read-only setting on the variable?

Thanks, Rik.

3 REPLIES 3

Not applicable

Might be a bug actually. Have to check the code to be sure, but it sounds plausible.

One workaround if you're up against the wall might be to see if you could put them on the form, but use a "read" role so they show up read only (instead of using the create role so they don't show up at all).

Possible alternate workaround would be to just put a client script on their that hides all those variables instead of removing them via the create role.


rburgering
Kilo Contributor

When setting the 'read' role, the field will not be visible if you do not have the role. When you set the 'create' role, the field will be read only if you do not have the role.

Sounds like opposite of what you suggest.....

The field(s) I want to target with this are in a variable set available on *all* services we currently have in development. This would mean we need to create client scripts for *all* services, since we can only connect client scripts to services.....

I know one suggestion was to create a script that can create client scripts for all services, but still I do not like that....

Any other ideas maybe?

Regards, Rik.


Not applicable

Not sure what's going on here now that I did a test. At least on current builds (like /demo), this seems to work fine.

I made the cpu_speed variable on our OOB executive desktop have a create role of admin.
I then logged in as an ITIL user and ordered one.
CPU SPEED did not show up on order form (as expected)
CPU SPEED did show up on request item after order was placed

So either:

A) something weird is happening with your instance (configuration difference, scripts, etc)
B) this was a bug and we fixed it (although I dont' remember making any changes here)

If you open a ticket with support, they can try to help run down the root cause. If it's A we can probably tweak something or other and get it working. If its B, they we might be able to offer you a patch for it (since we already seem to have fixed it in current builds)