que cuando dentro de esta aplicación se dé de alta un usuario también lo haga en Alfresco
…
public static final String ADMIN_USERNAME = "admin";
public static final String ADMIN_PASSWORD = "admin";
public static final String GROUP_AUTHORITY_TYPE = "GROUP";
public static final String CP01_USERNAME = "cp01";
protected static final String CONTENT_PROVIDER_GROUPNAME = "RBT_CONTENT_PROVIDER";
public static void main(String[] args) throws Exception {
// Start the session
AuthenticationUtils.startSession(ADMIN_USERNAME, ADMIN_PASSWORD);
try {
createGroups();
//createUsers();
addUsersToGroup();
} finally {
// End the session
AuthenticationUtils.endSession();
}
}
private static void createGroups() throws AccessControlFault, RemoteException {
AccessControlServiceSoapBindingStub accessControlService = WebServiceFactory.getAccessControlService();
NewAuthority cpGrpAuth = new NewAuthority(GROUP_AUTHORITY_TYPE, CONTENT_PROVIDER_GROUPNAME);
NewAuthority[] newAuthorities = {cpGrpAuth};
String result[] = accessControlService.createAuthorities(null, newAuthorities);
}
private static void addUsersToGroup() throws AccessControlFault, RemoteException {
String[] cpUsers = {CP01_USERNAME};
String parentAuthority = GROUP_AUTHORITY_TYPE + "_" + CONTENT_PROVIDER_GROUPNAME;
AccessControlServiceSoapBindingStub accessControlService = WebServiceFactory.getAccessControlService();
String[] result = accessControlService.addChildAuthorities(parentAuthority,
cpUsers);
}
…
Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.