@@ -24,24 +24,24 @@ def test_get_user_role_permissions(test_linode_client):
2424 assert isinstance (user_permissions ["account_access" ], list )
2525
2626
27- @pytest .mark .skip (
28- reason = "Updating IAM role permissions may require elevated privileges."
29- )
30- def test_set_user_role_permissions (test_linode_client ):
27+ def test_set_user_role_permissions (test_linode_client , test_firewall ):
3128 client = test_linode_client
32- iam = client . iam
29+ firewall_id = test_firewall . id
3330
3431 username = client .profile ().username
35- entity_access = [EntityAccess (id = 1 , type = "linode" , roles = ["read_only" ])]
32+ user_permissions = client .iam .role_permissions_user_get (username )["account_access" ]
33+ entity_access = EntityAccess (id = firewall_id , type = "firewall" , roles = ["firewall_admin" ]).dict
3634
37- updated = iam .role_permissions_user_set (
35+ updated_perms = client . iam .role_permissions_user_set (
3836 username ,
39- account_access = [ "read_only" ] ,
40- entity_access = entity_access ,
37+ account_access = user_permissions ,
38+ entity_access = [ entity_access ] ,
4139 )
4240
43- assert "account_access" in updated
44- assert "entity_access" in updated
41+ assert "account_access" in updated_perms
42+ assert updated_perms ["entity_access" ][0 ]["id" ] == firewall_id
43+ assert updated_perms ["entity_access" ][0 ]["roles" ] == ["firewall_admin" ]
44+ assert updated_perms ["entity_access" ][0 ]["type" ] == "firewall"
4545
4646
4747def test_list_entities (test_linode_client ):
0 commit comments