Package jeeves.server

Examples of jeeves.server.UserSession


  public Element exec(Element params, ServiceContext context) throws Exception
  {
    GeonetContext gc = (GeonetContext) context.getHandlerContext(Geonet.CONTEXT_NAME);
    AccessManager am = gc.getBean(AccessManager.class);
    UserSession   us = context.getUserSession();

    Element ownerId = new Element("ownerid").setText(us.getUserId());
    Element hasOwner = new Element("owner").setText("true");

    //--- get all operations
        List<Operation> operationList = context.getBean(OperationRepository.class).findAll();
View Full Code Here


  //---
  //--------------------------------------------------------------------------

  public Element serviceSpecificExec(Element params, ServiceContext context) throws Exception
  {
    UserSession session = context.getUserSession();

    String id          = Util.getParam(params, Params.ID);
    String[] ref         = Util.getParam(params, Params.REF).split(",");
    String parentRef  = Util.getParam(params, Params.PARENT);
View Full Code Here

    public Element serviceSpecificExec(Element params, ServiceContext context) throws Exception {

        GeonetContext gc = (GeonetContext) context.getHandlerContext(Geonet.CONTEXT_NAME);
        DataManager dataMan = gc.getBean(DataManager.class);

        UserSession session = context.getUserSession();

        String id = Utils.getIdentifierFromParameters(params, context);
        String schemaName = dataMan.getMetadataSchema(id);

        //--- validate metadata from session
View Full Code Here

    String organ    = Util.getParam(params, Params.ORG,     "");
    String kind     = Util.getParam(params, Params.KIND,    "");


    // check old password
    UserSession session = context.getUserSession();
    String      userId  = session.getUserId();

    if (userId == null)
      throw new UserNotFoundEx(null);

        final UserRepository userRepository = context.getBean(UserRepository.class);
View Full Code Here

     * @param id    The metadata internal identifier
     * @return
     * @throws Exception
     */
    public boolean hasEditPermission(final ServiceContext context, final String id) throws Exception {
        UserSession us = context.getUserSession();
        if (!us.isAuthenticated())
            return false;


        List<OperationAllowed> allOpAlloweds = _opAllowedRepository.findAll(where(hasMetadataId(id)).and(hasOperation(ReservedOperation
                .editing)));
        if (allOpAlloweds.isEmpty()) {
            return false;
        }

        Specifications spec = where (UserGroupSpecs.hasProfile(Profile.Editor)).and(UserGroupSpecs.hasUserId(us.getUserIdAsInt()));

        List<Integer> opAlloweds = new ArrayList<Integer>();
        for (OperationAllowed opAllowed : allOpAlloweds) {
          opAlloweds.add(opAllowed.getId().getGroupId());
        }
View Full Code Here

    //--------------------------------------------------------------------------

    public Element exec(Element params, ServiceContext context) throws Exception {
        String id = params.getChildText(Params.ID);

        UserSession usrSess = context.getUserSession();
        if (!usrSess.isAuthenticated()) return new Element(Jeeves.Elem.RESPONSE);

        Profile myProfile = usrSess.getProfile();
        String myUserId = usrSess.getUserId();

        if (id == null) return new Element(Jeeves.Elem.RESPONSE);

        if (myProfile == Profile.Administrator || myProfile == Profile.UserAdmin || myUserId.equals(id)) {
View Full Code Here

    String country  = Util.getParam(params, Params.COUNTRY, null);
    String email    = Util.getParam(params, Params.EMAIL,   null);
    String organ    = Util.getParam(params, Params.ORG,     null);
        String kind     = Util.getParam(params, Params.KIND, null);

        UserSession usrSess = context.getUserSession();
        Profile myProfile = usrSess.getProfile();
        String      myUserId  = usrSess.getUserId();

        final UserGroupRepository groupRepository = context.getBean(UserGroupRepository.class);
        final UserRepository userRepository = context.getBean(UserRepository.class);
        @SuppressWarnings("unchecked")
        java.util.List<Element> userGroups = params.getChildren(Params.GROUPS);
View Full Code Here

  {
    GeonetContext gc = (GeonetContext) context.getHandlerContext(Geonet.CONTEXT_NAME);

    DataManager dm = gc.getBean(DataManager.class);
    AccessManager accessMan = gc.getBean(AccessManager.class);
    UserSession us = context.getUserSession();


    context.info("Get selected metadata");
    SelectionManager sm = SelectionManager.getManager(us);
View Full Code Here

  public Element serviceSpecificExec(Element params, ServiceContext context) throws Exception
  {
    String id = Util.getParam(params, Params.ID);

    UserSession usrSess = context.getUserSession();
    Profile myProfile = usrSess.getProfile();
    String      myUserId  = usrSess.getUserId();

    GeonetContext gc = (GeonetContext) context.getHandlerContext(Geonet.CONTEXT_NAME);
    DataManager dataMan = gc.getBean(DataManager.class);

    if (myUserId.equals(id)) {
View Full Code Here

  public Element exec(Element params, ServiceContext context) throws Exception
  {
    GeonetContext gc = (GeonetContext) context.getHandlerContext(Geonet.CONTEXT_NAME);
    DataManager   dataMan   = gc.getBean(DataManager.class);
    AccessManager accessMan = gc.getBean(AccessManager.class);
    UserSession   session   = context.getUserSession();

    Set<Integer> metadata = new HashSet<Integer>();
    Set<Integer> notFound = new HashSet<Integer>();
    Set<Integer> notOwner = new HashSet<Integer>();
View Full Code Here

TOP

Related Classes of jeeves.server.UserSession

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.