With this code:
my $host_view = Vim::find_entity_view( view_type => 'HostSystem' ); $permission = Permission->new( principal => "$localuser", group => 'false', roleId => FindRoleID( $authMgr, $rolename ), propagate => 'true', ); @permissions = ($permission); $authMgr->SetEntityPermissions( entity => $host_view, permission => @permissions, );
I want to assign a local user a custom role (both exist). The role should be assigned on the root level of the host, so that's why I use the view_type HostSystem. What am I doing wrong? Thanks in advance