clish hook access [access issue]

46 views
Skip to first unread message

Srikala Sandu

unread,
Feb 3, 2023, 5:07:34 AM2/3/23
to klish-dev
Hello, I am a recent college graduate and fairly new to klish.
I have a doubt regarding the permission issues.

So I have created a view :
<VIEW name="abc-view" prompt="abc> " access="user1 user2">
after adding the hook neither of the users were unable to access that particular view.
so my question is should access be written as access="user1" access="user2" > ?

Also I have 2 commands with the same name which is show but one is for user1 and the other is user2. some commands are there for both but most are under user1 and user2 has to access the user1 commands too. but because of the same command name I am getting an error Error parsing XML: Duplicate COMMAND name="show". 

so I have renamed the command so there is no error for duplication, even if I allow the access for user2 I am not able to see the commands. if there is no access I am seeing the result in the cli as           show           show-user2
where show only has commands that user1 can access and show-user2 has commands where both users can access.  I want the same command name but for user2 to only have the commands it can access. and how do I proceed with that?

Serj Kalichev

unread,
Feb 6, 2023, 4:28:34 AM2/6/23
to klis...@googlegroups.com
Hello.

All text are for klish2 but not klish3.

String 'prompt="abc> "' is illegal because XML engine consider '>' as end of the tag. So you must use 'prompt="abc&gt; "'.
Do you have your own access hook? Standard access hook checks if current user is member of specified group.
access="some_group"
It doesn't use user names.
Access is a single attribute.
access="group1 group2" is right string but access="group1" access="group2" are wrong.

Yes, klish doesn't allow two commands with the same name.
You can implement different behaviour within command's ACTION for different users.
Or you can use different XML files for different users while klish execution.


03.02.2023 13:07, Srikala Sandu пишет:
--
You received this message because you are subscribed to the Google Groups "klish-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to klish-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/klish-dev/bb0f4ffd-53e9-4d80-80ae-bbbef43ff900n%40googlegroups.com.


Reply all
Reply to author
Forward
0 new messages