How to delete a group?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2009 08:28 AM
I have used this code :
but get this error: trying to modify a fixed authority.
How must i do?
public static boolean deleteGroups(String groupname) { boolean control=true; String[] delgroup = {groupname}; try{ AccessControlServiceSoapBindingStub accessControlService = WebServiceFactory.getAccessControlService(); NewAuthority cpGrpAuth = new NewAuthority(GROUP_AUTHORITY_TYPE,groupname); NewAuthority[] newAuthorities = {cpGrpAuth}; accessControlService.deleteAuthorities(delgroup); } catch(Exception e) { e.printStackTrace(); control=false; } return control; }
but get this error: trying to modify a fixed authority.
How must i do?
Labels:
- Labels:
-
Archive
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2009 02:39 PM
You need to obtain the node reference to the user group and use the nodeService to delete the node.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2009 03:46 AM
You need to obtain the node reference to the user group and use the nodeService to delete the node.can you give me a code please?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2009 06:40 AM
You need to obtain the node reference to the user group and use the nodeService to delete the node.can you give me a code please?
or a simple example…

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2009 12:15 PM
Hi Spizzico,
I see that you're using Alfresco 2.9. I was not as "fortunate" to use that version. My experience has been in 3.0 and I don't know what the differences are. In 3.0, you can utilize the AuthorityService to delete the user group. There is an overloaded (one cascades, while the other does not) method AuthorityService.deleteAuthority(....) that you can use to delete the user group.
I see that you're using Alfresco 2.9. I was not as "fortunate" to use that version. My experience has been in 3.0 and I don't know what the differences are. In 3.0, you can utilize the AuthorityService to delete the user group. There is an overloaded (one cascades, while the other does not) method AuthorityService.deleteAuthority(....) that you can use to delete the user group.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2010 10:48 AM
Hello, for Alfresco 3.2r2 I delete User Groups
public StringBuilder deleteGroup(String alfrescoAxisUrl, String groupName) throws AccessControlFault, RemoteException { StringBuilder stringBuilder = new StringBuilder(); AccessControlServiceSoapBindingStub accessControlService = WebServiceFactory .getAccessControlService(alfrescoAxisUrl); AuthorityFilter authorityFilter = new AuthorityFilter(); authorityFilter.setAuthorityType(GROUP); String[] deleteAuthorities = {Constants.GROUP_PREFIX + groupName}; accessControlService.deleteAuthorities(deleteAuthorities); stringBuilder.append("Delete Group"); stringBuilder.append("\n"); return stringBuilder; }
