Ability to manage access rights for VIEW in Klish 3

18 views
Skip to first unread message

Aleksander Djuric

unread,
Jul 23, 2025, 11:02:55 AMJul 23
to klish
Hi, I want to restrict access to a VIEW commands in my project.

I found that the Section "Visibility of the COMMAND tag " of the Legacy Plan document ( https://src.libcode.org/pkun/klish/src/master/docs/legacy-plan.ru.md ) states:
"There is currently an 'access' field for the commands, but it is static, i.e. it is checked when klish is started".

Can you give an example of how to use this feature in Klish 3?

I tried to use this field in following manner:
<VIEW name="config" access="wheel">
...but it doesn't seem to work in Klish 3 (

If this feature is not still implemented, then perhaps you can give a hint or an example of how the new field can be added into the VIEW?

Thanks in advance

Serj Kalichev

unread,
Jul 23, 2025, 11:26:05 AMJul 23
to kl...@googlegroups.com
Hi

The 'access' field is obsoleted and not planned to implement for Klish 3.
The Klish 3 will get nested COND tag for the similar task. Unfortunately it's planned but not implemented yet. It will work like 'access' but dynamically. The documentation has a description for the COND.

Right now you can use multi-ACTIONs to restrict access.

<COMMAND name="my command"...>
  <ACTION sym="my_check_access"/>
  <ACTION ...>#real action here</ACTION>
</COMMAND>

If the first ACTION returns not-null return code it considered as failed. By default if the first ACTION failed the second will not be executed. The difference between unimplemented COND and checking ACTION is the restricted user can get help and completion for this command. In a case of COND user will not see such command at all.

The multi-ACTION works for the COMMAND but don't works for the whole VIEW.
--
You received this message because you are subscribed to the Google Groups "klish" group.
To unsubscribe from this group and stop receiving emails from it, send an email to klish+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/klish/3732db0a-c48a-4497-b5ec-975a12b4e288n%40googlegroups.com.


Aleksander Djuric

unread,
Jul 23, 2025, 12:37:17 PMJul 23
to klish
Hi Serge, Thank you very much for your quick reply. This is a great solution.
I should have figured it out myself )

среда, 23 июля 2025 г. в 18:26:05 UTC+3, Serj Kalichev:

Aleksander Djuric

unread,
Jul 23, 2025, 1:51:12 PMJul 23
to klish
Multi-ACTIONs to restrict access works well. But it's not quite what I need. The command is shown, but can't be executed. I think that the nested COND tag will be more useful.

Looking forward to updates
Regards
среда, 23 июля 2025 г. в 19:37:17 UTC+3, Aleksander Djuric:
Reply all
Reply to author
Forward
0 new messages