Repository: softlayer/softlayer-python
Pull request #1890 (2023-03-23 17:17:31)

Updated request to list all permissions to users
Issue: #1888 
```
softlayer-python/ (issue1888) $ slcli user edit-permissions --enable --permission MANAGE_PRIVATE_ENDPOINT_SERVICE  765
Permissions updated successfully: MANAGE_PRIVATE_ENDPOINT_SERVICE
```


Patch:
diff --git a/SoftLayer/fixtures/SoftLayer_User_Permission_Action.py b/SoftLayer/fixtures/SoftLayer_User_Permission_Action.py
new file mode 100644
index 00000000..5b747269
--- /dev/null
+++ b/SoftLayer/fixtures/SoftLayer_User_Permission_Action.py
@@ -0,0 +1,42 @@
+getAllObjects = [
+    {
+        "key": "T_1",
+        "keyName": "TICKET_VIEW",
+        "name": "View Tickets"
+    },
+    {
+        "key": "T_2",
+        "keyName": "TEST",
+        "name": "A Testing Permission"
+    },
+    {
+        "key": "T_3",
+        "keyName": "TEST_3",
+        "name": "A Testing Permission 3"
+    },
+    {
+        "key": "T_4",
+        "keyName": "TEST_4",
+        "name": "A Testing Permission 4"
+    },
+    {
+        "key": "T_5",
+        "keyName": "ACCESS_ALL_HARDWARE",
+        "name": "A Testing Permission 5"
+    },
+    {
+        'key': 'ALL_1',
+        'keyName': 'ACCESS_ALL_HARDWARE',
+        'name': 'All Hardware Access'
+    },
+    {
+        'key': 'A_1',
+        'keyName': 'ACCOUNT_SUMMARY_VIEW',
+        'name': 'View Account Summary'
+    },
+    {
+        'key': 'A_10',
+        'keyName': 'ADD_SERVICE_STORAGE',
+        'name': 'Add/Upgrade Storage (StorageLayer)'
+    }
+]
diff --git a/SoftLayer/managers/user.py b/SoftLayer/managers/user.py
index 5f55f6b5..605b47b6 100644
--- a/SoftLayer/managers/user.py
+++ b/SoftLayer/managers/user.py
@@ -82,7 +82,7 @@ def get_all_permissions(self):
         :returns: A list of dictionaries that contains all valid permissions
         """
         if self.all_permissions is None:
-            permissions = self.client.call('User_Customer_CustomerPermission_Permission', 'getAllObjects')
+            permissions = self.client.call('User_Permission_Action', 'getAllObjects')
             self.all_permissions = sorted(permissions, key=itemgetter('keyName'))
         return self.all_permissions
 


Test patch:
diff --git a/tests/CLI/modules/user_tests.py b/tests/CLI/modules/user_tests.py
index 31f10b64..72c0a8fc 100644
--- a/tests/CLI/modules/user_tests.py
+++ b/tests/CLI/modules/user_tests.py
@@ -113,7 +113,7 @@ def test_print_hardware_access(self):
     def test_permissions_list(self):
         result = self.run_command(['user', 'permissions', '11100'])
         self.assert_no_fail(result)
-        self.assert_called_with('SoftLayer_User_Customer_CustomerPermission_Permission', 'getAllObjects')
+        self.assert_called_with('SoftLayer_User_Permission_Action', 'getAllObjects')
         self.assert_called_with(
             'SoftLayer_User_Customer', 'getObject', identifier=11100,
             mask='mask[id, permissions, isMasterUserFlag, roles]'
diff --git a/tests/managers/user_tests.py b/tests/managers/user_tests.py
index a9ed5af3..89f54469 100644
--- a/tests/managers/user_tests.py
+++ b/tests/managers/user_tests.py
@@ -73,7 +73,7 @@ def test_get_user_mask(self):
 
     def test_get_all_permissions(self):
         self.manager.get_all_permissions()
-        self.assert_called_with('SoftLayer_User_Customer_CustomerPermission_Permission', 'getAllObjects')
+        self.assert_called_with('SoftLayer_User_Permission_Action', 'getAllObjects')
 
     def test_add_permissions(self):
         self.manager.add_permissions(1234, ['TEST'])
@@ -168,7 +168,7 @@ def test_get_id_from_username_zero_match(self):
 
     def test_format_permission_object(self):
         result = self.manager.format_permission_object(['TEST'])
-        self.assert_called_with('SoftLayer_User_Customer_CustomerPermission_Permission', 'getAllObjects')
+        self.assert_called_with('SoftLayer_User_Permission_Action', 'getAllObjects')
         self.assertEqual([{'keyName': 'TEST'}], result)
 
     def test_format_permission_object_all(self):
@@ -176,7 +176,7 @@ def test_format_permission_object_all(self):
             {'key': 'T_2', 'keyName': 'TEST', 'name': 'A Testing Permission'},
             {'key': 'T_1', 'keyName': 'TICKET_VIEW', 'name': 'View Tickets'}
         ]
-        service_name = 'SoftLayer_User_Customer_CustomerPermission_Permission'
+        service_name = 'SoftLayer_User_Permission_Action'
         permission_mock = self.set_mock(service_name, 'getAllObjects')
         permission_mock.return_value = expected
         result = self.manager.format_permission_object(['ALL'])