cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

How can i delete a user assigned to various groups when he logged in and add him to respective group assigned from an external system dynamically?

aakash.d2
1-Newbie

How can i delete a user assigned to various groups when he logged in and add him to respective group assigned from an external system dynamically?

I need help on deleting all the user assigned group programmatically and assign him to new group set on logging In.

1 ACCEPTED SOLUTION

Accepted Solutions
ankigupta
5-Regular Member
(To:aakash.d2)

Hi Aakash D​,

Sushant Pandey already answered your query.

Let me give you an example; to add a User to Developer Group we can use following code:

var params = {

    member: "UserNameHere" /* STRING */,

    type: "User" /* STRING */

};

// no return

Groups["Developers"].AddMember(params);

View solution in original post

4 REPLIES 4
ankigupta
5-Regular Member
(To:aakash.d2)

Hi Aakash D​,

Could you please share your usecase in more detail. Are you using any ActiveDirectory for Authentication or are you using any custom Authenticator?

Hi Ankit Gupta​,

My process is actually after authentication, I will get the logged in user but I couldn't add the user to the respective user group dynamically.Is there a way through services in Thing

ankigupta
5-Regular Member
(To:aakash.d2)

Hi Aakash D​,

Sushant Pandey already answered your query.

Let me give you an example; to add a User to Developer Group we can use following code:

var params = {

    member: "UserNameHere" /* STRING */,

    type: "User" /* STRING */

};

// no return

Groups["Developers"].AddMember(params);

supandey
19-Tanzanite
(To:aakash.d2)

Aakash have you already checked the default services available under Organization, Groups and even for individual users. Like for a particular Group you have services like AddMember(), AssignMembers(), DeleteMembers() and you'll see similar ones for Organization as well.

Top Tags