Delete a user group using alfresco SDK

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2008 05:51 AM
Hi all,
I am new to user management in alfresco and i am working on alfresco SDK.
i have created a new user group in alfresco sdk using the following code
AuthorityService authorityService=serviceRegistry.getAuthorityService();
authorityService.createAuthority(AuthorityType.GROUP, null, "Ajay_Group_NEW");
my question is now i want to delete user group "Ajay_Group_NEW" using SDK?
i have tried with 2 options
1.authorityService.removeAuthority(null, "Ajay_Group_NEW");
2. authorityService.deleteAuthority("Ajay_Group_NEW");
both are not working
what is the option? pls help
I am new to user management in alfresco and i am working on alfresco SDK.
i have created a new user group in alfresco sdk using the following code
AuthorityService authorityService=serviceRegistry.getAuthorityService();
authorityService.createAuthority(AuthorityType.GROUP, null, "Ajay_Group_NEW");
my question is now i want to delete user group "Ajay_Group_NEW" using SDK?
i have tried with 2 options
1.authorityService.removeAuthority(null, "Ajay_Group_NEW");
2. authorityService.deleteAuthority("Ajay_Group_NEW");
both are not working
what is the option? pls help
Labels:
- Labels:
-
Archive
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2008 08:04 AM
Hi,
Try this.
This is because, internally all group names are prefixed by GROUP_ and best way is to call getName and then delete the authority like above.
This way even if the prefix is changed your code will not break.
Best Regards,
Shagul
Try this.
authorityService.deleteAuthority(authorityService.getName(AuthorityType.GROUP,"Ajay_Group_NEW"));
This is because, internally all group names are prefixed by GROUP_ and best way is to call getName and then delete the authority like above.
This way even if the prefix is changed your code will not break.
Best Regards,
Shagul

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2008 10:20 PM
Thks a lot… that was a perfect solution

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2008 11:50 PM
one more doubt,
if i create a group in alfresco, where the group details like group name and others will be stored in database?
if i create a group in alfresco, where the group details like group name and others will be stored in database?
