bugy / script-server

Web UI for your scripts with execution management
Other
1.52k stars 244 forks source link

Script not available to execute for Admin User #686

Closed TheSteveBennett closed 11 months ago

TheSteveBennett commented 11 months ago

I have a script that can be executed by certain users but certain admin users can't see it from the main menu. Where do I need to look to correct this?

bugy commented 11 months ago

Hi @TheSteveBennett, if you want admin users to be able to see (and execute) the script, you have to give them access explicitly. You can use @admin_users group, to give an access to all admins at once

TheSteveBennett commented 11 months ago

Do I have to edit the JSON file for the script or can I do that from the admin panel. If I can do that from the admin panel then what would prevent me from doing so?

bugy commented 11 months ago

You can edit it from the admin panel. Of course, usually admins have extended access to scripts/server and can execute anything. In this case access settings is only to prevent unintended invocation of a script by an admin. E.g. if by a company policy, a script should be only executed by a Financial department. Then for admins, it will be obvious, that they shouldn't do it, since there is no access. At least, that was my way of thinking about it, when I implemented this restriction :)

TheSteveBennett commented 11 months ago

Thank you. When I use the @admin_users and hit save, nothing happens and when I edit the json file directly the script disappears from the menu until I remove my changes.

From: Iaroslav Shepilov @.> Sent: Thursday, July 27, 2023 4:39 PM To: bugy/script-server @.> Cc: Steve Bennett @.>; Mention @.> Subject: [External] Re: [bugy/script-server] Script not available to execute for Admin User (Issue #686)

CAUTION: This email originated from outside the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

You can edit it from the admin panel. Of course, usually admins have extended access to scripts/server and can execute anything. In this case access settings is only to prevent unintended invocation of a script by an admin. E.g. if by a company policy, a script should be only executed by a Financial department. Then for admins, it will be obvious, that they shouldn't do it, since there is no access. At least, that was my way of thinking about it, when I implemented this restriction :)

- Reply to this email directly, view it on GitHubhttps://github.com/bugy/script-server/issues/686#issuecomment-1654536479, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AWE7SBWVQ5KBETU5PV76AQTXSLGV3ANCNFSM6AAAAAA22R5YRM. You are receiving this because you were mentioned.Message ID: @.**@.>>

bugy commented 11 months ago

When I use the @admin_users and hit save, nothing happens

Could you try pressing "Enter" before pressing Save?

when I edit the json file directly the script disappears from the menu until I remove my changes

Please check logs/server.log file. Most probably there is missing comma in json file or smth similar

TheSteveBennett commented 11 months ago

Brillant! That did it. Thank you.

When I use the @admin_users and hit save, nothing happens

Could you try pressing "Enter" before pressing Save?

when I edit the json file directly the script disappears from the menu until I remove my changes

Please check logs/server.log file. Most probably there is missing comma in json file or smth similar

bugy commented 11 months ago

I'm glad it worked :)