Project

General

Profile

« Previous | Next » 

Revision 2245

Added by sgarg over 19 years ago

Merging in changes made in branch 'dataaccess' by Jing Tao.

View differences:

MetaCatServlet.java
823 823
            PermissionController controller = new PermissionController(docId);
824 824
            // check top level read permission
825 825
            if (!controller.hasPermission(user, groups,
826
                    AccessControlInterface.READSTRING)) {
826
                    AccessControlInterface.READSTRING))
827
            {
827 828
                throw new Exception("User " + user
828 829
                        + " doesn't have permission " + " to read document "
829 830
                        + docId);
830
            } else if (controller.hasSubTreeAccessControl()) {
831
                // if the document has subtree control, we need to check
832
                // subtree control
833
                // get node id for inlinedata
834
                long nodeId = getInlineDataNodeId(inlineDataId, docId);
835
                if (!controller.hasPermissionForSubTreeNode(user, groups,
836
                    AccessControlInterface.READSTRING, nodeId)) {
837
                    throw new Exception(
838
                    "User " + user + " doesn't have permission "
839
                    + " to read inlinedata " + inlineDataId);
840
                }
841 831
            }
832
            else
833
            {
834
              //check data access level
835
              try
836
              {
837
                Hashtable unReadableInlineDataList =
838
                PermissionController.getUnReadableInlineDataIdList(docId,user,groups);
839
                if (unReadableInlineDataList.containsValue(inlineDataId))
840
                {
841
                  throw new Exception("User " + user
842
                       + " doesn't have permission " + " to read inlinedata "
843
                       + inlineDataId);
842 844

  
845
                }//if
846
              }//try
847
              catch (Exception e)
848
              {
849
                throw e;
850
              }//catch
851
            }//else
852

  
843 853
            // Get output stream
844 854
            out = response.getOutputStream();
845 855
            // read the inline data from the file
......
972 982
                qformat = ((String[]) params.get("qformat"))[0];
973 983
            }
974 984
            // the param for only metadata (eml)
975
            if (params.containsKey("inlinedata")) {
985
            // we don't support read a eml document without inline data now.
986
            /*if (params.containsKey("inlinedata")) {
976 987

  
977 988
                String inlineData = ((String[]) params.get("inlinedata"))[0];
978 989
                if (inlineData.equalsIgnoreCase("false")) {
979 990
                    withInlineData = false;
980 991
                }
981
            }
992
            }*/
982 993
            if ((docs.length > 1) || qformat.equals("zip")) {
983 994
                zip = true;
984 995
                out = response.getOutputStream();

Also available in: Unified diff