5
0
mirror of https://github.com/apache/sqoop.git synced 2025-05-07 00:39:46 +08:00

SQOOP-2220: Sqoop2: Fix the privilege check on job using the link id not the connector id

(Guoquan Shen via Abraham Elmahrek)
This commit is contained in:
Abraham Elmahrek 2015-03-23 23:34:25 -07:00
parent 598607cde6
commit d615b39c10
2 changed files with 12 additions and 4 deletions

View File

@ -130,6 +130,14 @@ public long getLinkId(Direction type) {
}
}
public long getFromLinkId() {
return fromLinkId;
}
public long getToLinkId() {
return toLinkId;
}
public long getConnectorId(Direction type) {
switch(type) {
case FROM:

View File

@ -185,11 +185,11 @@ private JsonBean createUpdateJob(RequestContext ctx, boolean create) {
// Authorization check
if (create) {
AuthorizationEngine.createJob(String.valueOf(postedJob.getFromConnectorId()),
String.valueOf(postedJob.getToConnectorId()));
AuthorizationEngine.createJob(String.valueOf(postedJob.getFromLinkId()),
String.valueOf(postedJob.getToLinkId()));
} else {
AuthorizationEngine.updateJob(String.valueOf(postedJob.getFromConnectorId()),
String.valueOf(postedJob.getToConnectorId()),
AuthorizationEngine.updateJob(String.valueOf(postedJob.getFromLinkId()),
String.valueOf(postedJob.getToLinkId()),
String.valueOf(postedJob.getPersistenceId()));
}