natxoasenjo
Enthusiast
Enthusiast

SetentityPermissions error: a specified parameter was not correct: entity

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

Reply
0 Kudos
natxoasenjo
Enthusiast
Enthusiast

and as usual after asking the question I find the answer on my own :slightly_smiling_face: https://communities.vmware.com/message/1008552#1008552 It seems I need to apply the permissions on the top folder:

my $host_view = Vim::find_entity_view(
    view_type => 'Folder',
    filter=> { 'name' => 'ha-folder-root' }
);
Reply
0 Kudos