Examples of User


Examples of cn.iver.model.User

        // validate user info from bbs_id
        if(controller.getSessionAttr("user") == null && StringKit.notBlank(controller.getCookie("bbsID"))){
            String bbsID = controller.getCookie("bbsID");
            if(StringKit.notBlank(bbsID)){
                String[] userAndEmail = bbsID.split(Const.BBS_ID_SEPARATOR);
                User user = null;
                if(userAndEmail != null && userAndEmail.length == 2){
                    user = User.dao.getByEmailAndPassword(userAndEmail[0], userAndEmail[1]);
                }
                if(user != null){
                    controller.getSession().setMaxInactiveInterval(1800);
                    controller.setSessionAttr("user", user);
                    controller.setSessionAttr("userID", user.get("id"));
                }else{
                    ai.getController().removeCookie("bbsID");
                }
            }
        }
View Full Code Here

Examples of co.arcs.groove.thresher.User

    public Set<Song> call() throws Exception {

        bus.post(new GetSongsToSyncStartedEvent(this));
        bus.post(new GetSongsToSyncProgressChangedEvent(this, 0, 3));

        User user = client.login(username, password);

        bus.post(new GetSongsToSyncProgressChangedEvent(this, 1, 3));

        // The library.get() response contains favorited songs that do not have
        // the 'favorited' property set. To work around this, favorites are
        // removed from the library set and replaced with instances from the
        // favorites set. The result is that all songs within the resulting set
        // are 'collected', and some are 'favorited'.
        ImmutableSet<Song> library = ImmutableSet.copyOf(user.library().get());

        bus.post(new GetSongsToSyncProgressChangedEvent(this, 2, 3));

        ImmutableSet<Song> favorites = ImmutableSet.copyOf(user.favorites().get());

        SetView<Song> nonFavorites = Sets.difference(library, favorites);
        SetView<Song> all = Sets.union(nonFavorites, favorites);

        bus.post(new GetSongsToSyncProgressChangedEvent(this, 3, 3));
View Full Code Here

Examples of co.cubicode.rbacframework.models.User

public class RBACTest extends ApiTest {

  @Test
  public void rbacTest() throws ObjectNotFoundException {
    User user = UserBiz.findByPrimaryKey(1L);
    Role role = RoleBiz.findByPrimaryKey(user.getRole().getId());
    List<RolePermission> ids = RolePermissionBiz.findByRoleAndApplication(role, ApplicationConstants.ADMIN);
    List<Permission> permissions = new ArrayList<Permission>();
    for (RolePermission rolePermission : ids) {
      Permission permission = PermissionBiz.findByPrimaryKey(rolePermission.getApplicationId(), rolePermission.getObjectTypeId(),
          rolePermission.getOperationTypeId());
      permissions.add(permission);
    }
    role.setPermissions(permissions);
    user.setRole(role);
    System.out.println(user);

    if (user.hasRole("administrator")) {
      System.out.println("Es administrador");
    } else if (user.hasRole("operator")) {
      System.out.println("Es operador");
      Assert.fail();
    } else if (user.hasRole("guest")) {
      System.out.println("Es invitado");
      Assert.fail();
    } else {
      System.out.println("No tiene rol");
      Assert.fail();
    }
   
    Action action = Catalog.getElement(Action.class, "2");
    Permission permission = new Permission(action.getApplication(), action.getObjectType(), action.getOperationType());
    if (user.hasPermission(permission)) {
      Assert.fail();
    } else {
      System.out.println("No tiene permisos en web");
    }
  }
View Full Code Here

Examples of co.nubetech.crux.model.User

public class TestWelcomeAction {

  @Test
  public void testWelcomeDashboardExists(){
    User user = new User();
    user.setId(12);
    user.setName("user");
    user.setPassword("password1");

    Datastore datastore = new Datastore();
    datastore.setId(121212);
    datastore.setName("Hbase");
   
View Full Code Here

Examples of com.adito.security.User

    }

    private boolean setDefaultUser(String[] toMatch) throws Exception {
        for (String username : toMatch) {
            if (!Util.isNullOrTrimmedBlank(username) && userDatabase.isAccountNameInUse(username)) {
                User user = userDatabase.getAccount(username);
                account = user.getPrincipalName();
                email = user.getEmail();
                return true;
            }
        }
        return false;
    }
View Full Code Here

Examples of com.adobe.idp.um.api.infomodel.User

                DirectoryManagerServiceClient dirClient = new DirectoryManagerServiceClient(liveCycleService.getServiceClientFactory());
                psf.setUserIdAbsolute(userName);
                List<?> principalList = null;
                principalList = dirClient.findPrincipals(psf);
                Iterator<?> pit = principalList.iterator();
                User lcUser = null;
                if (pit.hasNext())
                    lcUser = (User) (pit.next());
                canonicalName = lcUser.getCanonicalName();
                userLogin =  lcUser.getUserid();
                userFullName = lcUser.getCommonName();
                domainName = lcUser.getDomainName();
                userRights = new String[lcUser.getRoleMembership().size()];
                int counter = 0;
                for (Object o : lcUser.getRoleMembership()) {

                    RoleImpl role = (RoleImpl)o;
                    if(role.getId().equals("BASIC_ROLE_APPLICATION_ADMINISTRATOR")){
                        this.admin = true;
                    }
View Full Code Here

Examples of com.aetrion.flickr.people.User

        Response response = transport.post(transport.getPath(), parameters);
        if (response.isError()) {
            throw new FlickrException(response.getErrorCode(), response.getErrorMessage());
        }
        Element userElement = response.getPayload();
        User user = new User();
        user.setId(userElement.getAttribute("id"));

        Element usernameElement = (Element) userElement.getElementsByTagName("username").item(0);
        user.setUsername(((Text) usernameElement.getFirstChild()).getData());

        return user;
    }
View Full Code Here

Examples of com.agilebooster.data.entity.User

     * Init the test environment.
     */
    @BeforeClass
    public static void initContext() {
        userController = new UserController();
        scrumMaster = new User("ScrumMaster@agilebooster.fr", "Forename", "Last Name", "password", true);
        scrumMaster = userController.create(scrumMaster);
        productOwner = new User("ProductOwner@agilebooster.fr", "Forename", "Last Name", "password", true);
        productOwner = userController.create(productOwner);

        projectController = new ProjectController();
        Date date = new Date();
        project = new Project("Test Sprint ", "TST", "Project Sprint test.", date, "http://www.testSprint.com", "http://www.Sprint.git", scrumMaster, productOwner);
View Full Code Here

Examples of com.agiletec.aps.system.services.user.User

      closeConnection(conn);
    }
  }
 
  public void addUser(String username, String nome, String cognome, String email, boolean cat1, boolean cat2) throws ApsSystemException {
    User user = new User();
    user.setUsername(username);
    user.setPassword(username);
    user.setDisabled(false);
    this._userManager.addUser(user);
    this.addProfile(username, nome, cognome, email, cat1, cat2);
  }
View Full Code Here

Examples of com.alibaba.druid.spring.User

        SqlMapClientImpl client = (SqlMapClientImpl) context.getBean("master-sqlMapClient");
        Assert.assertNotNull(client);

        SqlMapClientWrapper wrapper = new SqlMapClientWrapper(client);

        wrapper.insert("User.insert", new User(12345678, "aaa"));
        {
            Exception error = null;
            try {
                wrapper.insert("User.insert");
            } catch (Exception ex) {
                error = ex;
            }
            Assert.assertNotNull(error);
        }
        wrapper.update("User.update", new User(12345678, "bbb"));
        {
            Exception error = null;
            try {
                wrapper.update("User.update");
            } catch (Exception ex) {
                error = ex;
            }
            Assert.assertNotNull(error);
        }

        Assert.assertNotNull((User) wrapper.queryForObject("User.select"));
        Assert.assertNotNull((User) wrapper.queryForObject("User.select", Collections.emptyMap()));
        Assert.assertNotNull((User) wrapper.queryForObject("User.select", Collections.emptyMap(), new User()));

        Assert.assertEquals(1, wrapper.queryForList("User.select").size());
        Assert.assertEquals(1, wrapper.queryForList("User.select", Collections.emptyMap()).size());
        Assert.assertEquals(1, wrapper.queryForList("User.select", Collections.emptyMap(), 0, 2).size());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.