-
Notifications
You must be signed in to change notification settings - Fork 304
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2993 from juliemturner/version-4
V4 release updates
- Loading branch information
Showing
6 changed files
with
104 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# @pnp/graph/members | ||
|
||
Members are collections of users and other principals. Other API objects have membership so all membership functionality is encapsulated in one import. | ||
|
||
## IMember, IMembers | ||
|
||
[![Invokable Banner](https://img.shields.io/badge/Invokable-informational.svg)](../concepts/invokable.md) [![Selective Imports Banner](https://img.shields.io/badge/Selective%20Imports-informational.svg)](../concepts/selective-imports.md) | ||
|
||
## List Group Members/Owners | ||
|
||
Get the members and/or owners of a group. | ||
|
||
```TypeScript | ||
import { graphfi } from "@pnp/graph"; | ||
import "@pnp/graph/groups"; | ||
import "@pnp/graph/members"; | ||
|
||
const graph = graphfi(...); | ||
const members = await graph.groups.getById({groupId}).members(); | ||
const owners = await graph.groups.getById({groupId}).owners(); | ||
``` | ||
|
||
## Add Member/Owner | ||
|
||
Add a member/owner to an group | ||
|
||
```TypeScript | ||
import { graphfi } from "@pnp/graph"; | ||
import "@pnp/graph/groups"; | ||
import "@pnp/graph/members"; | ||
|
||
const graph = graphfi(...); | ||
const members = await graph.groups.getById({groupId}).members.add({directoryObjectId}). | ||
const owners = await graph.groups.getById({groupId}).owners.add({directoryObjectId}); | ||
``` | ||
|
||
## Remove Member/Owner | ||
|
||
Remove a member/owner to an group | ||
|
||
```TypeScript | ||
import { graphfi } from "@pnp/graph"; | ||
import "@pnp/graph/groups"; | ||
import "@pnp/graph/members"; | ||
|
||
const graph = graphfi(...); | ||
const members = await graph.groups.getById({groupId}).members.getById({directoryObjectId}).remove(). | ||
const owners = await graph.groups.getById({groupId}).owners.getById({directoryObjectId}).remove(); | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters