Package org.joget.directory.model

Examples of org.joget.directory.model.User


                permission.setProperties((Map) permissionMap.get("properties"));
                permission.setRequestParameters(formData.getRequestParams());
               
                WorkflowUserManager workflowUserManager = (WorkflowUserManager) AppUtil.getApplicationContext().getBean("workflowUserManager");
                ExtDirectoryManager directoryManager = (ExtDirectoryManager) AppUtil.getApplicationContext().getBean("directoryManager");
                User user = directoryManager.getUserByUsername(workflowUserManager.getCurrentUsername());
                permission.setCurrentUser(user);
               
                isAuthorize = permission.isAuthorize();
            }
        }
View Full Code Here


        }

        //process json with hash variable
        json = AppUtil.processHashVariable(json, null, StringUtil.TYPE_JSON, null);

        User currentUser = directoryManager.getUserByUsername(workflowUserManager.getCurrentUsername());

        if (requestParameters == null) {
            requestParameters = new HashMap<String, Object>();
        }
        requestParameters = convertRequestParamMap(requestParameters);
View Full Code Here

    public static String getUserAttribute(String username, String attribute) {
        String attributeValue = null;

        try {
            DirectoryManager directoryManager = (DirectoryManager) appContext.getBean("directoryManager");
            User user = directoryManager.getUserByUsername(username);

            if (user != null) {
                //convert first character to upper case
                char firstChar = attribute.charAt(0);
                firstChar = Character.toUpperCase(firstChar);
View Full Code Here

    }

    public static String getCurrentUserFullName() {
        DirectoryManager directoryManager = (DirectoryManager) appContext.getBean("directoryManager");
        String username = getCurrentUsername();
        User user = directoryManager.getUserByUsername(username);
        if (user != null && user.getFirstName() != null && user.getFirstName().trim().length() > 0) {
            return user.getFirstName() + " " + user.getLastName();
        } else {
            return username;
        }
    }
View Full Code Here

    protected String getUserAttribute(String username, String attribute) {
        String attributeValue = null;

        try {
            User user = userCache.get(username);
            if (user == null) {
                ApplicationContext appContext = AppUtil.getApplicationContext();
                DirectoryManager directoryManager = (DirectoryManager) appContext.getBean("directoryManager");
                user = directoryManager.getUserByUsername(username);
                userCache.put(username, user);
View Full Code Here

public class DepartmentPermission extends UserviewPermission implements PluginWebSupport, FormPermission {

    @Override
    public boolean isAuthorize() {
        User user = getCurrentUser();

        if (user != null && user.getEmployments() != null && user.getEmployments().size() > 0) {
            Employment e = (Employment) user.getEmployments().iterator().next();

            StringTokenizer strToken = new StringTokenizer(getPropertyString("allowedDeptIds"), ";");
            while (strToken.hasMoreTokens()) {
                String deptId = (String) strToken.nextElement();
                if (deptId.equals(e.getDepartmentId())) {
View Full Code Here

public class OrganizationPermission extends UserviewPermission implements PluginWebSupport, FormPermission {

    @Override
    public boolean isAuthorize() {
        User user = getCurrentUser();

        if (user != null && user.getEmployments() != null && user.getEmployments().size() > 0) {
            Employment e = (Employment) user.getEmployments().iterator().next();

            StringTokenizer strToken = new StringTokenizer(getPropertyString("allowedOrgIds"), ";");
            while (strToken.hasMoreTokens()) {
                String orgId = (String) strToken.nextElement();
                if (orgId.equals(e.getOrganizationId())) {
View Full Code Here

    protected String getUserAttribute(String username, String attribute) {
        String attributeValue = null;

        try {
            User user = userCache.get(username);
            if (user == null) {
                ApplicationContext appContext = AppUtil.getApplicationContext();
                DirectoryManager directoryManager = (DirectoryManager) appContext.getBean("directoryManager");
                user = directoryManager.getUserByUsername(username);
                userCache.put(username, user);
View Full Code Here

public class UserPermission extends UserviewPermission implements PluginWebSupport, FormPermission {

    @Override
    public boolean isAuthorize() {
        User user = getCurrentUser();

        if (user != null) {
            StringTokenizer strToken = new StringTokenizer(getPropertyString("allowedUsernames"), ";");
            while (strToken.hasMoreTokens()) {
                String username = (String) strToken.nextElement();
                if (username.equals(user.getUsername())) {
                    return true;
                }
            }
        }
View Full Code Here

        if (participant != null && participant.getValue() != null) {
            ApplicationContext appContext = AppUtil.getApplicationContext();
            DirectoryManager directoryManager = (DirectoryManager) appContext.getBean("directoryManager");
            String[] users = participant.getValue().replaceAll(";", ",").split(",");
            for (String userId : users) {
                User user = directoryManager.getUserById(userId);
                if (user != null && user.getActive() == User.ACTIVE) {
                    resultList.add(user.getUsername());
                }
            }
        }
        return resultList;
    }
View Full Code Here

TOP

Related Classes of org.joget.directory.model.User

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.