Examples of HAccount


Examples of org.zanata.model.HAccount

        assertThat(translatorList.get(editorClientId).getPerson().getName(),
                Matchers.equalTo("pahuang"));
    }

    private static HAccount createHAccount(String email, String name) {
        HAccount hAccount = new HAccount();
        HPerson hPerson = new HPerson();
        hPerson.setEmail(email);
        hPerson.setName(name);
        hAccount.setPerson(hPerson);
        return hAccount;
    }
View Full Code Here

Examples of org.zanata.model.HAccount

    public void release(Lock l) {
        locks.remove(l);
    }

    private String getCurrentUser() {
        HAccount user =
                ServiceLocator.instance().getInstance(
                        JpaIdentityStore.AUTHENTICATED_USER, HAccount.class);
        String newLocker = user != null ? user.getUsername() : "unknown";
        return newLocker;
    }
View Full Code Here

Examples of org.zanata.model.HAccount

                // apply the rule
                account.getRoles().add(rule.getRoleToAssign());
            }
        }

        HAccount persistedAcc = accountDAO.makePersistent(account);
        accountDAO.flush();
        return persistedAcc;
    }
View Full Code Here

Examples of org.zanata.model.HAccount

                identityStore.createUser(username, null);
                identityStore.disableUser(username);
            }
        }.addRole("admin").run();

        HAccount account = accountDAO.getByUsername(username);
        HPerson person = new HPerson();
        person.setAccount(account);
        person.setEmail(email);
        person.setName(name);
View Full Code Here

Examples of org.zanata.model.HAccount

                identityStore.createUser(username, password);
                identityStore.disableUser(username);
            }
        }.addRole("admin").run();

        HAccount account = accountDAO.getByUsername(username);
        HPerson person = new HPerson();
        person.setAccount(account);
        person.setEmail(email);
        person.setName(name);
View Full Code Here

Examples of org.zanata.model.HAccount

                                                          // initially
                identityStore.disableUser(username);
            }
        }.addRole("admin").run();

        HAccount account = accountDAO.getByUsername(username);
        account.getCredentials().add(
                new HOpenIdCredentials(account, externalId, email));
        HPerson person = new HPerson();
        person.setAccount(account);
        person.setEmail(email);
        person.setName(name);
View Full Code Here

Examples of org.zanata.model.HAccount

    }

    @Test
    public void injectActionAndAllow() throws Exception {
        assertThat(complexPermissionEvaluator
                .checkPermission("action-should-grant", new HAccount()))
                .isTrue();
    }
View Full Code Here

Examples of org.zanata.model.HAccount

    }

    @Test
    public void injectActionAndDeny() throws Exception {
        assertThat(complexPermissionEvaluator
                .checkPermission("action-should-deny", new HAccount()))
                .isFalse();
    }
View Full Code Here

Examples of org.zanata.model.HAccount

    @BeforeMethod
    public void setUp() {
        MockitoAnnotations.initMocks(this);
        deleteAllTables();
        HAccount authenticatedUser =
                EntityMakerBuilder.builder().includeOptionalOneToOne().build()
                        .makeAndPersist(getEm(), HAccount.class);
        service = seam.reset()
                .use("entityManager", getEm())
                .use("session", getSession())
View Full Code Here

Examples of org.zanata.model.HAccount

    private static HTextFlowTarget addHTextFlowTarget(HLocale hLocale,
            HTextFlow hTextFlow, String username) {
        HTextFlowTarget hTextFlowTarget =
                new HTextFlowTarget(hTextFlow, hLocale);
        HPerson lastModifiedBy = new HPerson();
        HAccount account = new HAccount();
        account.setUsername(username);
        lastModifiedBy.setAccount(account);
        hTextFlowTarget.setLastModifiedBy(lastModifiedBy);
        hTextFlowTarget.setLastChanged(new Date());
        return hTextFlowTarget;
    }
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.