2

In an application I'm building, I have to create and manage groups based on business rules. Each group must have properties like managers (yes, several managers) and members, with some other properties. Security will be applied to theses groups, and other list can have group selector in their columns.

How should I implement such feature ?

As I have to apply security based on these groups, I have to create SPGroups

As I have to add extra metadata to the groups, I cannot use SPGroup.

The only way I see is to define a custom list, with receivers that will synchronize my list data with a SPGroup.

Is there any better solution ?

2

Since I done similar thing recently I think this is simplest solution.

Custom list with two user fields: one for managers and other for members. Simple receiver can be developed that creates/updates/deletes groups based on list item user field values. In my case I used one group for managers and one for members. List item can contain additional group 'metadata'.

One tip: when creating new group it is good choice to write back group id to list item containing 'metadata'. When updating/deleting group you can use this id to find desired group. Getting SPGroups by name is IMHO not safe because group names can be changed manually but group ids are 'static'.

  • good tip. I'll follow it – Steve B Jun 14 '12 at 8:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.