Skip to content

Commit 26b9f40

Browse files
committed
940
1 parent 64b1670 commit 26b9f40

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

src/sempy_labs/admin/_items.py

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,9 @@ def list_items(
188188

189189
@log
190190
def list_item_access_details(
191-
item: str | UUID = None,
192-
type: str = None,
191+
item: str | UUID,
192+
type: str,
193193
workspace: Optional[str | UUID] = None,
194-
**kwargs,
195194
) -> pd.DataFrame:
196195
"""
197196
Returns a list of users (including groups and service principals) and lists their workspace roles.
@@ -204,7 +203,7 @@ def list_item_access_details(
204203
----------
205204
item : str
206205
Name or id of the Fabric item.
207-
type : str, default=None
206+
type : str
208207
Type of Fabric item.
209208
workspace : str | uuid.UUID, default=None
210209
The Fabric workspace name or id.
@@ -216,17 +215,6 @@ def list_item_access_details(
216215
pandas.DataFrame
217216
A pandas dataframe showing a list of users (including groups and service principals) and lists their workspace roles.
218217
"""
219-
if "item_name" in kwargs:
220-
print(
221-
"The 'item_name' parameter has been deprecated. Please replace this parameter with 'item' from the function going forward."
222-
)
223-
item = kwargs["item_name"]
224-
del kwargs["item_name"]
225-
226-
if item is None or type is None:
227-
raise ValueError(
228-
f"{icons.red_dot} The parameter 'item' and 'type' are mandatory."
229-
)
230218

231219
(workspace_name, workspace_id) = _resolve_workspace_name_and_id(workspace)
232220
(item_name, item_id) = _resolve_item_name_and_id(
@@ -246,8 +234,12 @@ def list_item_access_details(
246234
}
247235
df = _create_dataframe(columns=columns)
248236

237+
url = f"/v1/admin/workspaces/{workspace_id}/items/{item_id}/users"
238+
if type in ['Report', 'Dashboard', 'SemanticModel', 'App', 'Dataflow']:
239+
url = f"/v1/admin/workspaces/{workspace_id}/items/{item_id}/users?type={type}"
240+
249241
response = _base_api(
250-
request=f"/v1/admin/workspaces/{workspace_id}/items/{item_id}/users",
242+
request=url,
251243
client="fabric_sp",
252244
)
253245

0 commit comments

Comments
 (0)