de.intarsys.pdf.crypt.AccessPermissionsDocMDP Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jpod Show documentation
Show all versions of jpod Show documentation
This is a fork of http://sourceforge.net/projects/jpodlib/ as development seems to be frozen.
We're providing some bug fixes along with deployments to maven.
package de.intarsys.pdf.crypt;
import de.intarsys.pdf.pd.PDTransformParams;
public class AccessPermissionsDocMDP extends AccessPermissionsProxy {
private PDTransformParams parameters;
public AccessPermissionsDocMDP(IAccessPermissions permissions, PDTransformParams parameters) {
super(permissions);
this.parameters = parameters;
}
public PDTransformParams getParameters() {
return parameters;
}
protected int getPermissions() {
return getParameters().getPermissions();
}
@Override
public boolean mayAssemble() {
switch (getPermissions()) {
case 0:
return super.mayAssemble();
default:
return false;
}
}
@Override
public boolean mayFillForm() {
switch (getPermissions()) {
case 1:
return false;
default:
return super.mayFillForm();
}
}
@Override
public boolean mayModify() {
switch (getPermissions()) {
case 0:
return super.mayModify();
default:
return false;
}
}
@Override
public boolean mayModifyAnnotation() {
switch (getPermissions()) {
case 0:
return false;
case 1:
return false;
case 2:
return false;
default:
return super.mayModifyAnnotation();
}
}
}