bugy / script-server

Web UI for your scripts with execution management
Other
1.61k stars 249 forks source link

option for hide parameter #434

Closed muzzol closed 3 years ago

muzzol commented 3 years ago

I would like to hide parameters but evaluate them, something like:

    {
        "name": "Operator",
        "description": "User executing script",
        "required": true,
        "env_var": "ID_OPERATOR",
        "default": "${auth.username}",
        "hidden": true
    }

is that possible?

bugy commented 3 years ago

Did you try constant? https://github.com/bugy/script-server/wiki/Script-config#--constant

muzzol commented 3 years ago

oops!!

sorry, I totally forgot about that property.

you can close this issue.

bugy commented 3 years ago

:+1:

TomFreudenberg commented 3 years ago

Hi Laroslav @bugy

first, thanks for this pretty cool tool !!! Works really well !!!

Just a question as addon to this:

Is it already possible to hide or to make visible a parameter just to a user or group?

I would append a DEBUG checkbox to my confs but that should be visible and changeable only by the @admin groups.

In scripts I could check then for those values

Thanks for a short feedback. Tom

bugy commented 3 years ago

Hi @TomFreudenberg unfortunately this is not possible

TomFreudenberg commented 3 years ago

@bugy does this make sense for you to have such a feature?

I could try to come up with a PR or file an issue if you like.

Cheers Tom

bugy commented 3 years ago

Hi Tom, this feature definitely makes sense. Please tell me if you need any assist

I think you could add such a filter to https://github.com/bugy/script-server/blob/master/src/model/script_config.py _reloadParameters method

You can check for user/group access using Authorizer class, as an example please check here: https://github.com/bugy/script-server/blob/master/src/config/config_service.py _can_edit_script (Instead of admin_users you would have to pass a custom list of user/groups which should see a parameter)