---
id: object/codeunit/9871
type: object
title: Codeunit 9871 "Security Group Impl."
summary: Codeunit 9871 "Security Group Impl." in System Application (System.Security.AccessControl). 22 public procedures, 2 events. Present since at least BC23, still in BC30, changed in BC24.
tier: official
language: en
tags:
  - codeunit
  - system application
versions:
  introduced: null
  last_changed: "24"
  deprecated: null
review:
  state: derived
  by: null
  at: null
  flags: []
generated:
  at: "2026-10-11T00:31:51.816Z"
  pipeline: 0.2.0
  prompts: {}
  input_hash: 224a4e95f54fc9da05353985775fe8874b5f95bebff540e452047a0bda975286
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/System%20Application/App/Security%20Groups/src/SecurityGroupImpl.Codeunit.al
    title: src/System Application/App/Security Groups/src/SecurityGroupImpl.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
object_type: codeunit
object_id: 9871
name: Security Group Impl.
namespace: System.Security.AccessControl
app: System Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "24"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 32
  events: 2
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 2
  called_by: 5
  implements: 0
---

# Codeunit 9871 "Security Group Impl."

> Codeunit 9871 "Security Group Impl." in System Application (System.Security.AccessControl). 22 public procedures, 2 events. Present since at least BC23, still in BC30, changed in BC24.

System Application · System.Security.AccessControl · BC23-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/System%20Application/App/Security%20Groups/src/SecurityGroupImpl.Codeunit.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| Access | Internal |
| Permissions | tabledata "Security Group" = rimd, tabledata User = rimd, tabledata "User Property" = rimd |

## Events published

- `OnIsWindowsAuthentication(var IsWindowsAuthentication: Boolean; var Handled: Boolean)` (internal)
- `OnBeforeCreateAadGroupUserInSaaS(var SecurityGroup: Record "Security Group"; GroupId: Text; GroupName: Text; var Handled: Boolean)` (internal)

## Procedures

- `ValidateGroupId(GroupId: Text)`
- `Create(GroupCode: Code[20]; GroupId: Text)`
- `Delete(GroupCode: Code[20])`
- `Copy(SourceGroupCode: Code[20]; DestinationGroupCode: Code[20]; DestinationGroupId: Text)`
- `CopyPermissions(SourceGroupCode: Code[20]; DestinationGroupCode: Code[20])`
- `AddPermissionSet(GroupCode: Code[20]; RoleId: Code[20]; Company: Text[30]; Scope: Option System,Tenant; AppId: Guid)`
- `RemovePermissionSet(GroupCode: Code[20]; RoleId: Code[20]; Company: Text[30]; Scope: Option System,Tenant; AppId: Guid): Boolean`
- `GetGroupUserSecurityId(GroupCode: Code[20]): Guid`
- `Export(SecurityGroupCodes: List of [Code[20]]; Destination: OutStream)`
- `Import(Source: InStream)`
- `GetAvailableGroups(var SecurityGroupBuffer: Record "Security Group Buffer")`
- `GetGroups(var SecurityGroupBuffer: Record "Security Group Buffer"; FetchGroupNames: Boolean)`
- `GetMembers(var SecurityGroupMemberBuffer: Record "Security Group Member Buffer"): List of [Code[20]]`
- `GetName(GroupCode: Code[20]; var GroupName: Text[250]): Boolean`
- `TryGetNameById(GroupId: Text; var GroupName: Text[250])`
- `GetId(GroupCode: Code[20]): Text[250]`
- `GetCode(GroupId: Text[250]; var GroupCode: Code[20]): Boolean`
- `GetIdByName(GroupName: Text): Text`
- `TryGetIdByName(GroupName: Text; var GroupId: Text)`
- `IsWindowsAuthentication(): Boolean`
- `SendNotificationForDeletedGroups(var SecurityGroupBuffer: Record "Security Group Buffer")`
- `GetDesirableCode(GroupName: Text): Code[20]`

Plus 8 local procedures.

## Calls

From the extracted call graph of BC29 (graphify-al on the snapshot checkout): calls whose target is known from a declared type or an `Object::"Name"` argument. Interface dispatch and calls through events are not counted, so the list is not complete.

- [Codeunit 9012 "Azure AD Graph"](../codeunit/9012.md) (4 calls: `FetchAllEntraGroups → GetGroups`, `TryGetEntraGroupMembers → GetMemberIdsPageForGroupId`, `TryGetIdByName → GetFirstGroupIdWithName`, …)
- [Codeunit 8703 "Feature Telemetry"](../codeunit/8703.md) (3 calls: `Create → LogUptake`, `GetMembers → LogUptake`, `GetMembers → LogUsage`)

## Called by

- [Codeunit 9031 "Security Group"](../codeunit/9031.md) (18 calls: `AddPermissionSet → AddPermissionSet`, `Copy → Copy`, `CopyPermissions → CopyPermissions`, …)
- [Codeunit 9872 "Security Group Upgrade"](../codeunit/9872.md) (2 calls: `GenerateGroupCode → GetDesirableCode`, `GenerateGroupCode → TryGetNameById`)
- [Page 9872 "New Security Group"](../page/9872.md) (2 calls: `LookupAvailableGroups → GetDesirableCode`, `ValidateGroupName → GetDesirableCode`)
- [Page 9873 "Copy Security Group"](../page/9873.md) (2 calls: `LookupAvailableGroups → GetDesirableCode`, `ValidateGroupName → GetDesirableCode`)
- [Page 9877 "Security Group Lookup"](../page/9877.md) (1 call: `OnOpenPage → GetAvailableGroups`)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC24

Source: AL metadata extracted from the code (names, ids, signatures, properties); no code bodies (D10).

## Ask your agent

Procedure bodies are not stored here (D10). The call sections above are our own, per object, from the BC29 call graph. For a procedure body or the calls of one procedure, ask bc-code-atlas (external, by Stefan Maron, MIT; default corpus w1-28), which the bc-observatory plugin connects: `bcatlas_resolve_node(object_type: "codeunit", object_name: "Security Group Impl.")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
