Azure / azure-libraries-for-net

Azure libraries for .Net
MIT License
380 stars 192 forks source link

[FEATURE REQ] Add method "withOwner" to IActiveDirectoryGroup #1141

Open ulkeba opened 4 years ago

ulkeba commented 4 years ago

Is your feature request related to a problem? Please describe. I want to create AAD groups with members and owners. My prototype can well specify the members using the fluent API as this code shows:

var newGroupBuilder = GraphRbacManager.Groups
  .Define(groupName)
  .WithEmailAlias(groupName)
  .WithMember(GraphRbacManager.Users.GetByName(userId));
var newGroup = newGroupBuilder.Create();

However, I also need to specify the group's owners. Unfortunatly, I could not figure out a way to specify group owners using the fluent API.

Describe the solution you'd like Similar to WithMember I'd love to have a method WithOwner that allows me to specify group owners. In the example above, the easiest approach would be to simply call:

newGroupBuilder.WithOwner(GraphRbacManager.Users.GetByName(userId));

Describe alternatives you've considered None so far.

Additional context From my point of view, the implementation should be quite straight forward: I could follow the implementation of WithMember in class ActiveDirectoryGroupImpl to method AddMemberAsync in GroupsOperationsExtensions. The latter also has a Method AddOwnerAsync already, that can probably be called from ActiveDirectoryGroupImpl easily.

Information Checklist

yungezz commented 4 years ago

hi @ulkeba .NET fluent SDK is in passive maintenance mode. There's new generation .NET SDK previewed at https://github.com/azurer/azure-sdk-for-net repo. cc @nickzhums for the ask on .NET SDK.