Package org.fao.geonet.exceptions

Examples of org.fao.geonet.exceptions.UnAuthorizedException


                    if(Log.isDebugEnabled(Geonet.MEF))
                        Log.debug(Geonet.MEF, "Deleting existing metadata with UUID : " + uuid);
                }
                // user does not hav privileges to replace the existing metadata
                else {
                    throw new UnAuthorizedException("User has no privilege to replace existing metadata", null);
                }
      }
    }
        catch (Exception e) {
            throw new Exception(" Existing metadata with UUID " + uuid + " could not be deleted. Error is: " + e.getMessage());
View Full Code Here


                (userSession.getProfile() != Profile.Administrator && userSession.isAuthenticated())) {
              if(!CollectionUtils.isEmpty(requestedGroups)) {
                    for(Element group : requestedGroups) {
                        if(! "".equals(group.getText())
                            && ! userGroups.contains(Integer.valueOf(group.getText()))) {
                            throw new UnAuthorizedException("You are not authorized to do this.", null);
                        }
                    }
                }
            }
View Full Code Here

    if (!dataMan.existsMetadata(iLocalId))
      throw new IllegalArgumentException("Metadata not found --> " + id);

    //--- only allow the owner of the record to set its status
    if (!am.isOwner(context, id)) {
      throw new UnAuthorizedException("Only the owner of the metadata can set the status. User is not the owner of the metadata", null);
    }

    String status = Util.getParam(params, Params.STATUS);
    String changeMessage = Util.getParam(params, Params.CHANGE_MESSAGE);
    ISODate changeDate = new ISODate();
View Full Code Here

TOP

Related Classes of org.fao.geonet.exceptions.UnAuthorizedException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.