Package jeeves.server

Examples of jeeves.server.UserSession


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

  public Element exec(Element params, ServiceContext context) throws Exception
  {
    UserSession   us   = context.getUserSession();
    Element result = new Element("response");

    // -- get the list of users (who are editors or above) from the database
    List<Element> list = OwnershipUtils.getEditorUsers(context, us);
    for (Element user : list) {
View Full Code Here


     * @throws Exception
     */
    @Override
  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);
    String name  = Util.getParam(params, Params.NAME);
    String child = params.getChildText(Params.CHILD);
View Full Code Here

        AjaxEditUtils ajaxEditUtils = new AjaxEditUtils(context);
        ajaxEditUtils.preprocessUpdate(params, context);

    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 isTemplate = Util.getParam(params, Params.TEMPLATE, "n");
    String showValidationErrors = Util.getParam(params, Params.SHOWVALIDATIONERRORS, "false");
    String data       = params.getChildText(Params.DATA);
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);

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

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

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

    String id  = Util.getParam(params, Params.ID);
    String ref = Util.getParam(params, Params.REF);

    //-----------------------------------------------------------------------
View Full Code Here

  public Element serviceSpecificExec(Element params, ServiceContext context) throws Exception
  {
    String password    = Util.getParam(params, Params.PASSWORD);
    String newPassword = Util.getParam(params, Params.NEW_PASSWORD);

    UserSession session = context.getUserSession();
    String      currentUserId  = session.getUserId();

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

    int iUserId = Integer.parseInt(currentUserId);
        ApplicationContext appContext = context.getApplicationContext();
View Full Code Here

  {
    String id = params.getChildText(Params.ID);

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

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

        final UserRepository userRepository = context.getBean(UserRepository.class);
        final GroupRepository groupRepository = context.getBean(GroupRepository.class);
        final UserGroupRepository userGroupRepository = context.getBean(UserGroupRepository.class);
View Full Code Here

     * @return
     * @throws Exception
     */
  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);

    Element child = new AjaxEditUtils(context).deleteAttributeEmbedded(session, id, ref);

View Full Code Here

        }
            else {
                results = new HashSet<Operation>(operations);
        }

        UserSession us = context.getUserSession();
            if (us.isAuthenticated() && us.getProfile() == Profile.Editor) {
                results.add(_opRepository.findReservedOperation(ReservedOperation.view));
            }
    }
   
    return results;
View Full Code Here

     *
     * @param sourceInfo    The metadata source/owner information
     */
    public boolean isOwner(ServiceContext context, MetadataSourceInfo sourceInfo) throws Exception {

        UserSession us = context.getUserSession();
        if (!us.isAuthenticated()) {
            return false;
        }

        //--- check if the user is an administrator
        final Profile profile = us.getProfile();
        if (profile == Profile.Administrator)
      return true;

        //--- check if the user is the metadata owner
        //
        if (us.getUserIdAsInt() == sourceInfo.getOwner())
      return true;

        //--- check if the user is a reviewer or useradmin
        if (profile != Profile.Reviewer && profile != Profile.UserAdmin)
            return false;
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.