Load 1C access profiles groups and users
This commit is contained in:
@@ -107,6 +107,33 @@ def test_index_project_keeps_extended_1c_metadata_objects(tmp_path: Path):
|
||||
}.issubset(by_kind)
|
||||
|
||||
|
||||
def test_index_project_links_access_profiles_groups_and_users(tmp_path: Path):
|
||||
xml = tmp_path / "access.xml"
|
||||
xml.write_text(
|
||||
"""
|
||||
<AccessData>
|
||||
<Role name="ЧтениеПродаж" qualifiedName="Роль.ЧтениеПродаж" />
|
||||
<AccessProfile name="МенеджерПродаж">
|
||||
<Role name="ЧтениеПродаж" />
|
||||
</AccessProfile>
|
||||
<AccessGroup name="ОтделПродаж" profile="МенеджерПродаж">
|
||||
<Member user="ivanov" />
|
||||
</AccessGroup>
|
||||
<InfobaseUser name="ivanov" fullName="Иванов Иван" />
|
||||
</AccessData>
|
||||
""",
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
snapshot = index_project(tmp_path, project_id="access-graph")
|
||||
|
||||
assert any(node.kind == NodeKind.ACCESS_PROFILE and node.name == "МенеджерПродаж" for node in snapshot.nodes)
|
||||
assert any(node.kind == NodeKind.ACCESS_GROUP and node.name == "ОтделПродаж" for node in snapshot.nodes)
|
||||
assert any(node.kind == NodeKind.ACCESS_USER and node.name == "ivanov" for node in snapshot.nodes)
|
||||
assert any(edge.kind == EdgeKind.ASSIGNS_ROLE for edge in snapshot.edges)
|
||||
assert any(edge.kind == EdgeKind.MEMBER_OF for edge in snapshot.edges)
|
||||
|
||||
|
||||
def test_index_project_remaps_edges_from_duplicate_metadata_nodes(tmp_path: Path):
|
||||
first = tmp_path / "first.xml"
|
||||
first.write_text(
|
||||
|
||||
Reference in New Issue
Block a user