Looking for a variable

Hi,
I am currently trying to change or force the view for a specific group inside my organization. I want to force them to use the pool view. I found how to do it on another thread, but it is using a specific username in his example. I would like to specify an administrators group instead. Currently I am using that;

Code:
(Proxmox.UserName === 'root@pam')

I was wondering what is the variable to use for a group.

Thank you very much
 
not really, as i said there is no simple way to do this... (the groups are not everywhere available in the gui code, you would have to do an api call and save that information somewhere...)
but why exactly do you want that? since it is the client code, every user can simply press f12 and edit it themselves to change the view (if they are somewhat tech-savvy)
 
We have around 50 employees that need to access the webgui. Some of them are basic call center techs that do not need to see anything except a few customer vms to reboot them sometimes. The only way I found to hide the nodes showing in the webgui was to force them to use the pool view.

I found an old thread from 2015 showing how to achieve that and its working perfectly for my needs right now. But I do not have only one administrator, so I need to A; Add them one by one in the code (Which is not ideal) or B; Find a way to use a group instead so I do not need to modify the code everytime.

Heres the code I am using right now.
Code:
    if (Proxmox.UserName === 'user@pve'){
    var default_views = {
        server: {
        text: gettext('Server View'),
        groups: ['node']
        },
        folder: {
        text: gettext('Folder View'),
        groups: ['type']
        },
        storage: {
        text: gettext('Storage View'),
        groups: ['node'],
        filterfn: function(node) {
            return node.data.type === 'storage' || node.data.type === 'node';
        }
        },
        pool: {
        text: gettext('Pool View'),
        groups: ['pool'],
                // Pool View only lists VMs and Containers
                filterfn: function(node) {
                    return node.data.type === 'qemu' || node.data.type === 'lxc' || node.data.type === 'openvz' ||
            node.data.type === 'pool';
                }
        }
    };
    }
    else {
    var default_views = {
        pool: {
        text: gettext('Pool View'),
        groups: ['pool'],
                // Pool View only lists VMs and Containers
                filterfn: function(node) {
                    return node.data.type === 'qemu' || node.data.type === 'lxc' || node.data.type === 'openvz' ||
            node.data.type === 'pool';
                }
        }
    };
    }
 
Some of them are basic call center techs that do not need to see anything except a few customer vms to reboot them sometimes.

This is a simple permission problem, just create pools of VMs with permissions accordingly and your support stuff will only see the VMs they need to see. All other are not visible.

I am currently trying to change or force the view for a specific group inside my organization.

Forcing the default view on connect is very easy, just give the correct URL, e.g. suffix /#v1:26:18:4::::::. Forcing that they cannot change the view is another problem.
 
  • Like
Reactions: iansimoneau
First of all, thanks for taking the time to answer.

Yeah that is exactly what I've done. But they still can see the node names and a few tabs like subscription, but they cannot open it because they have no rights. They cannot access anything so its not a security concern, it would just be better if they dont see them at all. The pool view is perfect because this particular view does not show the nodes/storage. Thats why I limited the users to that view in the code.

I did not know about the URL trick, trying to figure out the formatting and what each numbers are. I am changing view, but the URL do not seem to change.
 
The pool view is perfect because this particular view does not show the nodes/storage. Thats why I limited the users to that view in the code.

Yes, I had a similar problem. For the people in my company that use PVE like this, they're happy to open the remote console or restart. They don't mind all the other stuff they probably could see.
 
Its not perfect, but its working. So I'll continue like this for the moment. Thanks LnxBil and dcsapak

If someone is comfortable with coding and have a solution for me, we could make an arrangement. Since we're a company, we can unlock small budgets for this kind of stuff. Just PM me.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!