@Override
public AuthorizationResponse authorizeDocid(String docId, IUser user,
boolean checkMarkings) throws RepositoryException {
AuthorizationResponse authorizationResponse = null;
IVersionSeries versionSeries = null;
try {
logger.config("Getting version series for document DocID: "
+ docId);
versionSeries = (IVersionSeries) objectStore.getObject(ClassNames.VERSION_SERIES, URLDecoder.decode(docId, "UTF-8"));
} catch (UnsupportedEncodingException e) {
logger.log(Level.WARNING, "Unable to Decode: Encoding is not supported for the document with DocID: "
+ docId);
versionSeries = null;
} catch (RepositoryException e) {
logger.log(Level.WARNING, "Error : document Version Series Id "
+ docId + " may no longer exist. Message: "
+ e.getLocalizedMessage());
versionSeries = null;
}
if (versionSeries != null) {
logger.config("Authorizing DocID: " + docId + " for user: "
+ user.get_Name());
// Check whether the search user is authorized to view document
// contents or
// not.
IDocument releasedVersion = versionSeries.get_ReleasedVersion();
Permissions permissions = new Permissions(
releasedVersion.get_Permissions(), releasedVersion.get_Owner());
if (permissions.authorize(user)) {
logger.log(Level.INFO, "As per the ACLS User "
+ user.get_Name()