added edit permission validation
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@113494 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
cdb36a4e36
commit
d39ccb6db4
|
@ -141,6 +141,7 @@ import org.gcube.portlets.user.workspace.client.workspace.folder.item.GWTExterna
|
||||||
import org.gcube.portlets.user.workspace.client.workspace.folder.item.GWTExternalUrl;
|
import org.gcube.portlets.user.workspace.client.workspace.folder.item.GWTExternalUrl;
|
||||||
import org.gcube.portlets.user.workspace.client.workspace.folder.item.gcube.GWTImageDocument;
|
import org.gcube.portlets.user.workspace.client.workspace.folder.item.gcube.GWTImageDocument;
|
||||||
import org.gcube.portlets.user.workspace.client.workspace.folder.item.gcube.GWTUrlDocument;
|
import org.gcube.portlets.user.workspace.client.workspace.folder.item.gcube.GWTUrlDocument;
|
||||||
|
import org.gcube.portlets.user.workspace.shared.ReportAssignmentACL;
|
||||||
import org.gcube.portlets.user.workspace.shared.SessionExpiredException;
|
import org.gcube.portlets.user.workspace.shared.SessionExpiredException;
|
||||||
import org.gcube.portlets.user.workspace.shared.UserBean;
|
import org.gcube.portlets.user.workspace.shared.UserBean;
|
||||||
import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingField;
|
import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingField;
|
||||||
|
@ -2213,37 +2214,63 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
||||||
|
|
||||||
final List<String> logins = new ArrayList<String>(targets.size());
|
final List<String> logins = new ArrayList<String>(targets.size());
|
||||||
|
|
||||||
String names = "";
|
|
||||||
for (org.gcube.portlets.widgets.workspacesharingwidget.shared.InfoContactModel infoContactModel : targets) {
|
for (org.gcube.portlets.widgets.workspacesharingwidget.shared.InfoContactModel infoContactModel : targets) {
|
||||||
GWT.log(infoContactModel.toString());
|
GWT.log(infoContactModel.toString());
|
||||||
logins.add(infoContactModel.getLogin());
|
logins.add(infoContactModel.getLogin());
|
||||||
String name = infoContactModel.getName()!=null? infoContactModel.getName():infoContactModel.getLogin();
|
|
||||||
names+="<li><i>"+name +";</i></li>";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GWT.log("names "+names);
|
|
||||||
|
|
||||||
String msg = "Setting permission '"+multiDragContact.getSelectedAcl().getLabel() +"' for: <ul>"+names+"</ul> confirm?";
|
|
||||||
|
|
||||||
MessageBoxConfirm confirm = new MessageBoxConfirm("Setting new permissions to "+file.getName() +"?", msg);
|
|
||||||
|
|
||||||
confirm.getMessageBoxConfirm().addCallback(new Listener<MessageBoxEvent>() {
|
|
||||||
|
|
||||||
public void handleEvent(MessageBoxEvent be) {
|
rpcWorkspaceService.validateACLToUser(file.getIdentifier(), logins, multiDragContact.getSelectedAclID(), new AsyncCallback<ReportAssignmentACL>() {
|
||||||
|
|
||||||
//IF NOT CANCELLED
|
@Override
|
||||||
String clickedButton = be.getButtonClicked().getItemId();
|
public void onFailure(Throwable caught) {
|
||||||
if(clickedButton.equals(Dialog.YES)){
|
new MessageBoxAlert("Error", caught.getMessage(), null);
|
||||||
// doAddAdministratorToFolderId(file, logins);
|
|
||||||
setACLToFolderId(file.getIdentifier(), logins, multiDragContact.getSelectedAclID());
|
}
|
||||||
multidrag.hide();
|
|
||||||
}else if(clickedButton.equals(Dialog.CANCEL)){
|
@Override
|
||||||
multidrag.hide();
|
public void onSuccess(ReportAssignmentACL result) {
|
||||||
|
|
||||||
|
String msg = "";
|
||||||
|
|
||||||
|
if(result.getErrors().size()>0){
|
||||||
|
for (String error : result.getErrors()){
|
||||||
|
msg+="<li>"+error +";</li><br/>";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
new MessageBoxAlert("Warning!!", msg, null);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String names = "";
|
||||||
|
for (String name : result.getValidLogins()) {
|
||||||
|
// String name = infoContactModel.getName()!=null? infoContactModel.getName():infoContactModel.getLogin();
|
||||||
|
names+="<li><i>"+name +";</i></li>";
|
||||||
|
}
|
||||||
|
|
||||||
|
msg+= "Setting permission '"+multiDragContact.getSelectedAcl().getLabel() +"' for: <ul>"+names+"</ul> confirm?";
|
||||||
|
|
||||||
|
MessageBoxConfirm confirm = new MessageBoxConfirm("Setting new permissions to "+file.getName() +"?", msg);
|
||||||
|
confirm.getMessageBoxConfirm().addCallback(new Listener<MessageBoxEvent>() {
|
||||||
|
|
||||||
|
public void handleEvent(MessageBoxEvent be) {
|
||||||
|
|
||||||
|
//IF NOT CANCELLED
|
||||||
|
String clickedButton = be.getButtonClicked().getItemId();
|
||||||
|
if(clickedButton.equals(Dialog.YES)){
|
||||||
|
// doAddAdministratorToFolderId(file, logins);
|
||||||
|
setACLToFolderId(file.getIdentifier(), logins, multiDragContact.getSelectedAclID());
|
||||||
|
multidrag.hide();
|
||||||
|
}else if(clickedButton.equals(Dialog.CANCEL)){
|
||||||
|
multidrag.hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@ import org.gcube.portlets.user.workspace.client.model.SmartFolderModel;
|
||||||
import org.gcube.portlets.user.workspace.client.model.SubTree;
|
import org.gcube.portlets.user.workspace.client.model.SubTree;
|
||||||
import org.gcube.portlets.user.workspace.client.workspace.GWTWorkspaceItem;
|
import org.gcube.portlets.user.workspace.client.workspace.GWTWorkspaceItem;
|
||||||
import org.gcube.portlets.user.workspace.shared.ExtendedWorkspaceACL;
|
import org.gcube.portlets.user.workspace.shared.ExtendedWorkspaceACL;
|
||||||
|
import org.gcube.portlets.user.workspace.shared.ReportAssignmentACL;
|
||||||
import org.gcube.portlets.user.workspace.shared.SessionExpiredException;
|
import org.gcube.portlets.user.workspace.shared.SessionExpiredException;
|
||||||
import org.gcube.portlets.user.workspace.shared.TrashContent;
|
import org.gcube.portlets.user.workspace.shared.TrashContent;
|
||||||
import org.gcube.portlets.user.workspace.shared.TrashOperationContent;
|
import org.gcube.portlets.user.workspace.shared.TrashOperationContent;
|
||||||
|
@ -281,4 +282,14 @@ public interface GWTWorkspaceService extends RemoteService{
|
||||||
*/
|
*/
|
||||||
String getItemDescriptionById(String identifier) throws Exception;
|
String getItemDescriptionById(String identifier) throws Exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param folderId
|
||||||
|
* @param listLogins
|
||||||
|
* @param aclType
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
ReportAssignmentACL validateACLToUser(String folderId,
|
||||||
|
List<String> listLogins, String aclType) throws Exception;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@ import org.gcube.portlets.user.workspace.client.model.SmartFolderModel;
|
||||||
import org.gcube.portlets.user.workspace.client.model.SubTree;
|
import org.gcube.portlets.user.workspace.client.model.SubTree;
|
||||||
import org.gcube.portlets.user.workspace.client.workspace.GWTWorkspaceItem;
|
import org.gcube.portlets.user.workspace.client.workspace.GWTWorkspaceItem;
|
||||||
import org.gcube.portlets.user.workspace.shared.ExtendedWorkspaceACL;
|
import org.gcube.portlets.user.workspace.shared.ExtendedWorkspaceACL;
|
||||||
|
import org.gcube.portlets.user.workspace.shared.ReportAssignmentACL;
|
||||||
import org.gcube.portlets.user.workspace.shared.TrashContent;
|
import org.gcube.portlets.user.workspace.shared.TrashContent;
|
||||||
import org.gcube.portlets.user.workspace.shared.TrashOperationContent;
|
import org.gcube.portlets.user.workspace.shared.TrashOperationContent;
|
||||||
import org.gcube.portlets.user.workspace.shared.UserBean;
|
import org.gcube.portlets.user.workspace.shared.UserBean;
|
||||||
|
@ -226,4 +227,7 @@ public interface GWTWorkspaceServiceAsync {
|
||||||
void getItemDescriptionById(String identifier,
|
void getItemDescriptionById(String identifier,
|
||||||
AsyncCallback<String> callback);
|
AsyncCallback<String> callback);
|
||||||
|
|
||||||
|
void validateACLToUser(String folderId, List<String> listLogins,
|
||||||
|
String aclType, AsyncCallback<ReportAssignmentACL> callback);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -921,6 +921,7 @@ public class GWTWorkspaceBuilder {
|
||||||
return new InfoContactModel(portalLogin, portalLogin, UserUtil.getUserFullName(portalLogin), false);
|
return new InfoContactModel(portalLogin, portalLogin, UserUtil.getUserFullName(portalLogin), false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used in test mode
|
* Used in test mode
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,106 @@
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package org.gcube.portlets.user.workspace.server.util;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.gcube.common.homelibrary.home.workspace.accessmanager.ACLType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Class AclTypeComparator.
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||||
|
* Mar 5, 2015
|
||||||
|
*/
|
||||||
|
public class AclTypeComparator implements Comparator<ACLType>{
|
||||||
|
|
||||||
|
|
||||||
|
public static final Map<ACLType, Integer> aclTypeOrder;
|
||||||
|
static
|
||||||
|
{
|
||||||
|
aclTypeOrder = new LinkedHashMap<ACLType, Integer>();
|
||||||
|
aclTypeOrder.put(ACLType.READ_ONLY, 0);
|
||||||
|
aclTypeOrder.put(ACLType.WRITE_OWNER, 1);
|
||||||
|
aclTypeOrder.put(ACLType.WRITE_ALL, 2);
|
||||||
|
// aclTypeOrder.put(ACLType.ADMINISTRATOR, 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int compare(ACLType o1, ACLType o2) {
|
||||||
|
if(o1==null)
|
||||||
|
return -1;
|
||||||
|
if(o2==null)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
Integer order1 = aclTypeOrder.get(o1);
|
||||||
|
Integer order2 = aclTypeOrder.get(o2);
|
||||||
|
|
||||||
|
if(order1==null)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if(order2==null)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
if(order1==order2)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return order1<order2?-1:1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the allowed.
|
||||||
|
*
|
||||||
|
* @param aclType the acl type to compare
|
||||||
|
* @param includeEqual if true include equal ACLType, no otherwise
|
||||||
|
* @return the allowed
|
||||||
|
*/
|
||||||
|
public List<ACLType> getAllowed(ACLType aclType, boolean includeEqual) {
|
||||||
|
|
||||||
|
List<ACLType> allowed = new ArrayList<ACLType>();
|
||||||
|
|
||||||
|
if(aclType==null)
|
||||||
|
return allowed;
|
||||||
|
|
||||||
|
//IF MAP DOES NOT CONTAINS ACT TYPE IT IS NOT COMPARABLE
|
||||||
|
if(aclTypeOrder.get(aclType)==null)
|
||||||
|
return allowed;
|
||||||
|
|
||||||
|
for (ACLType aMap : aclTypeOrder.keySet()) {
|
||||||
|
int comparator = compare(aMap, aclType);
|
||||||
|
if(comparator==1)
|
||||||
|
allowed.add(aMap);
|
||||||
|
else if(includeEqual && comparator==0)
|
||||||
|
allowed.add(aMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
return allowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The main method.
|
||||||
|
*
|
||||||
|
* @param args the arguments
|
||||||
|
*/
|
||||||
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
AclTypeComparator comparator = new AclTypeComparator();
|
||||||
|
|
||||||
|
List<ACLType> allowed = comparator.getAllowed(ACLType.WRITE_ALL, false);
|
||||||
|
|
||||||
|
System.out.println(allowed);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,88 @@
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package org.gcube.portlets.user.workspace.shared;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||||
|
* Mar 6, 2015
|
||||||
|
*/
|
||||||
|
public class ReportAssignmentACL implements Serializable{
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private static final long serialVersionUID = -7218122043660957432L;
|
||||||
|
|
||||||
|
private List<String> validLogins;
|
||||||
|
private List<String> errors;
|
||||||
|
private String aclType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public ReportAssignmentACL() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the validLogins
|
||||||
|
*/
|
||||||
|
public List<String> getValidLogins() {
|
||||||
|
return validLogins;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param validLogins the validLogins to set
|
||||||
|
*/
|
||||||
|
public void setValidLogins(List<String> validLogins) {
|
||||||
|
this.validLogins = validLogins;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the errors
|
||||||
|
*/
|
||||||
|
public List<String> getErrors() {
|
||||||
|
return errors;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param errors the errors to set
|
||||||
|
*/
|
||||||
|
public void setErrors(List<String> errors) {
|
||||||
|
this.errors = errors;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the aclType
|
||||||
|
*/
|
||||||
|
public String getAclType() {
|
||||||
|
return aclType;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param aclType the aclType to set
|
||||||
|
*/
|
||||||
|
public void setAclType(String aclType) {
|
||||||
|
this.aclType = aclType;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see java.lang.Object#toString()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder builder = new StringBuilder();
|
||||||
|
builder.append("ReportValidationACL [validLogins=");
|
||||||
|
builder.append(validLogins);
|
||||||
|
builder.append(", errors=");
|
||||||
|
builder.append(errors);
|
||||||
|
builder.append(", aclType=");
|
||||||
|
builder.append(aclType);
|
||||||
|
builder.append("]");
|
||||||
|
return builder.toString();
|
||||||
|
}
|
||||||
|
}
|
|
@ -19,6 +19,7 @@ import org.gcube.common.homelibrary.home.workspace.exceptions.WorkspaceFolderNot
|
||||||
import org.gcube.common.scope.api.ScopeProvider;
|
import org.gcube.common.scope.api.ScopeProvider;
|
||||||
import org.gcube.common.scope.impl.ScopeBean;
|
import org.gcube.common.scope.impl.ScopeBean;
|
||||||
import org.gcube.portlets.user.workspace.server.util.AclTypeComparator;
|
import org.gcube.portlets.user.workspace.server.util.AclTypeComparator;
|
||||||
|
import org.gcube.portlets.user.workspace.shared.ReportAssignmentACL;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -60,8 +61,9 @@ public class EditPermissionsTest {
|
||||||
list.add("francesco.mangiacrapa");
|
list.add("francesco.mangiacrapa");
|
||||||
list.add("massimiliano.assante");
|
list.add("massimiliano.assante");
|
||||||
list.add("pasquale.pagano");
|
list.add("pasquale.pagano");
|
||||||
|
list.add("valentina.marioli");
|
||||||
|
|
||||||
validateACLToUser(sharedFolder, list, ACLType.WRITE_ALL.toString());
|
validateACLToUser(sharedFolder, list, ACLType.READ_ONLY.toString());
|
||||||
|
|
||||||
} catch (WorkspaceFolderNotFoundException e) {
|
} catch (WorkspaceFolderNotFoundException e) {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
|
@ -78,19 +80,26 @@ public class EditPermissionsTest {
|
||||||
} catch (ItemNotFoundException e) {
|
} catch (ItemNotFoundException e) {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
} catch (Exception e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static void validateACLToUser(WorkspaceFolder folder, List<String> listLogins, String aclType) {
|
private static ReportAssignmentACL validateACLToUser(WorkspaceFolder folder, List<String> listLogins, String aclType) throws Exception {
|
||||||
|
|
||||||
|
ReportAssignmentACL reportValidation = new ReportAssignmentACL();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
Map<ACLType, List<String>> mapACL = folder.getACLOwner();
|
Map<ACLType, List<String>> mapACL = folder.getACLOwner();
|
||||||
|
|
||||||
ACLType settingACL = ACLType.valueOf(aclType);
|
ACLType settingACL = ACLType.valueOf(aclType);
|
||||||
|
|
||||||
System.out.println("Tentative setting: "+settingACL);
|
System.out.println("Tentative setting: "+settingACL);
|
||||||
|
System.out.println("For Logins: "+listLogins);
|
||||||
|
|
||||||
AclTypeComparator comparator = new AclTypeComparator();
|
AclTypeComparator comparator = new AclTypeComparator();
|
||||||
|
|
||||||
|
@ -100,39 +109,66 @@ public class EditPermissionsTest {
|
||||||
listLogins.remove(admin);
|
listLogins.remove(admin);
|
||||||
System.out.println("Reject username: "+admin +" as "+ACLType.ADMINISTRATOR);
|
System.out.println("Reject username: "+admin +" as "+ACLType.ADMINISTRATOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<String> validLogins = new ArrayList<String>(listLogins);
|
||||||
|
List<String> errors = new ArrayList<String>();
|
||||||
|
|
||||||
|
|
||||||
for (String username : listLogins) {
|
for (String username : listLogins) {
|
||||||
System.out.println("\nChecking username: "+username);
|
System.out.println("\nChecking username: "+username);
|
||||||
for (ACLType aclHL : mapACL.keySet()) {
|
for (ACLType aclHL : mapACL.keySet()) {
|
||||||
|
|
||||||
|
if(!aclHL.equals(ACLType.ADMINISTRATOR)){
|
||||||
List<String> loginsHL = mapACL.get(aclHL);
|
List<String> loginsHL = mapACL.get(aclHL);
|
||||||
System.out.println("to ACLType: "+aclHL +", logins found: "+loginsHL);
|
System.out.println("to ACLType: "+aclHL +", logins found: "+loginsHL);
|
||||||
|
|
||||||
if(loginsHL.contains(username)){
|
if(loginsHL.contains(username)){
|
||||||
int cmp = comparator.compare(settingACL, aclHL);
|
int cmp = comparator.compare(settingACL, aclHL);
|
||||||
System.out.println("Compare result between "+aclHL + " and "+settingACL +": "+cmp);
|
System.out.println("Compare result between "+aclHL + " and "+settingACL +": "+cmp);
|
||||||
if(cmp==-1){
|
if(cmp==-1){
|
||||||
System.out.println("Reject ACL: "+settingACL+ " to "+username);
|
//CHANGE ACL IS NOT VALID
|
||||||
//CHANGE ACL IS NOT VALID
|
System.out.println("Reject ACL: "+settingACL+ " to "+username);
|
||||||
}else if(cmp==1){
|
validLogins.remove(username);
|
||||||
|
//TODO FULL NAME
|
||||||
|
errors.add("Unable for "+username+ " the grant of the privilege '"+settingACL+", it's lower than (already assigned) "+ aclHL);
|
||||||
|
break;
|
||||||
|
}else if(cmp==0){
|
||||||
|
//SAME ACL
|
||||||
|
System.out.println("Skipping ACL: "+settingACL+ " to "+username);
|
||||||
|
//TODO FULL NAME
|
||||||
|
errors.add("Ignoring for "+username+ " the grant of the privilege '"+settingACL+", it's already assigned");
|
||||||
|
validLogins.remove(username);
|
||||||
|
break;
|
||||||
|
}else if(cmp==1){
|
||||||
|
//CHANGE ACL IS VALID
|
||||||
|
System.out.println("Valid ACL: "+settingACL+ " to "+username);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
//CHANGE ACL IS VALID
|
//CHANGE ACL IS VALID
|
||||||
System.out.println("Set ACL: "+settingACL+ " to "+username);
|
System.out.println("[Login not found], Set ACL: "+settingACL+ " to "+username);
|
||||||
}else if(cmp==0){
|
|
||||||
//SAME ACL
|
|
||||||
System.out.println("Skipping ACL: "+settingACL+ " to "+username);
|
|
||||||
}
|
}
|
||||||
}else{
|
|
||||||
//CHANGE ACL IS VALID
|
|
||||||
System.out.println("[Login not found], Set ACL: "+settingACL+ " to "+username);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
System.out.println("\n");
|
||||||
|
for (String username : validLogins) {
|
||||||
|
System.out.println("Set ACL: "+settingACL+ " to "+username);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
System.out.println("\n");
|
||||||
|
for (String error : errors) {
|
||||||
|
System.out.println(error);
|
||||||
|
}
|
||||||
|
reportValidation.setAclType(aclType);
|
||||||
|
reportValidation.setErrors(errors);
|
||||||
|
reportValidation.setValidLogins(validLogins);
|
||||||
|
return reportValidation;
|
||||||
|
|
||||||
} catch (InternalErrorException e) {
|
} catch (InternalErrorException e) {
|
||||||
// TODO Auto-generated catch block
|
throw new Exception("Sorry, an error occurred when validating ACL assignment, try again later");
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue