Examples of loadRoleById()


Examples of com.dotmarketing.business.RoleAPI.loadRoleById()

    List<Map<String, Object>> children = new ArrayList<Map<String,Object>>();

    if(role!=null && role.getRoleChildren() != null) {
      for(String id : role.getRoleChildren()) {
        Role childRole = roleAPI.loadRoleById(id);

        if(onlyUserAssignableRoles) {
          //If the role has no children and is not user assignable then we don't include it
          if(!childRole.isEditUsers() && (childRole.getRoleChildren() == null || childRole.getRoleChildren().size() == 0))
            continue;
View Full Code Here

Examples of com.dotmarketing.business.RoleAPI.loadRoleById()

    RoleAPI roleAPI = APILocator.getRoleAPI();
    UserWebAPI uWebAPI = WebAPILocator.getUserWebAPI();
    HttpServletRequest request = ctx.getHttpServletRequest();
    UserAPI uAPI = APILocator.getUserAPI();

    Role role = roleAPI.loadRoleById(roleId);

    for(String userId : userIds) {
      User user = uAPI.loadUserById(userId, uWebAPI.getLoggedInUser(request), !uWebAPI.isLoggedToBackend(request));
      roleAPI.removeRoleFromUser(role, user);
    }
View Full Code Here

Examples of com.dotmarketing.business.RoleAPI.loadRoleById()

    RoleAPI roleAPI = APILocator.getRoleAPI();
    UserWebAPI uWebAPI = WebAPILocator.getUserWebAPI();
    HttpServletRequest request = ctx.getHttpServletRequest();
    UserAPI uAPI = APILocator.getUserAPI();

    Role role = roleAPI.loadRoleById(roleId);
    User user = uAPI.loadUserById(userId, uWebAPI.getLoggedInUser(request), !uWebAPI.isLoggedToBackend(request));

    User modUser = getUser();
    String date = DateUtil.getCurrentDate();
    ActivityLogger.logInfo(getClass(), "Adding Role: " +role.getName() + " to User: " + user.getUserId() , "Date: " + date + "; "+ "User:" + modUser.getUserId());
View Full Code Here

Examples of com.dotmarketing.business.RoleAPI.loadRoleById()

    role.setEditPermissions(canEditPermissions);
    role.setEditLayouts(canEditLayouts);
    role.setDescription(description);

    if(parentRoleId != null) {
      Role parentRole = roleAPI.loadRoleById(parentRoleId);
      role.setParent(parentRole.getId());
    }

    User user = getUser();
    String date = DateUtil.getCurrentDate();
View Full Code Here

Examples of com.dotmarketing.business.RoleAPI.loadRoleById()

  public Map<String, Object> updateRole (String roleId, String roleName, String roleKey, String parentRoleId, boolean canEditUsers, boolean canEditPermissions,
      boolean canEditLayouts,  String description) throws DotDataException, DotRuntimeException, PortalException, SystemException {
    RoleAPI roleAPI = APILocator.getRoleAPI();

    Role role = roleAPI.loadRoleById(roleId);
    role.setName(roleName);
    role.setRoleKey(roleKey);
    role.setEditUsers(canEditUsers);
    role.setEditPermissions(canEditPermissions);
    role.setEditLayouts(canEditLayouts);
View Full Code Here

Examples of com.dotmarketing.business.RoleAPI.loadRoleById()

    role.setEditPermissions(canEditPermissions);
    role.setEditLayouts(canEditLayouts);
    role.setDescription(description);

    if(parentRoleId != null) {
      Role parentRole = roleAPI.loadRoleById(parentRoleId);
      role.setParent(parentRole.getId());
    } else {
      role.setParent(role.getId());
    }
View Full Code Here

Examples of com.dotmarketing.business.RoleAPI.loadRoleById()



  public boolean deleteRole (String roleId) throws DotDataException, DotStateException, DotSecurityException, SystemException, PortalException {
    RoleAPI roleAPI = APILocator.getRoleAPI();
    Role role = roleAPI.loadRoleById(roleId);
    User user = getUser();
    String date = DateUtil.getCurrentDate();   

    ActivityLogger.logInfo(getClass(), "Deleting Role", "Date: " + date + "; "+ "User:" + user.getUserId() + "; RoleID: " + role.getId() );
    AdminLogger.log(getClass(), "Deleting Role", "Date: " + date + "; "+ "User:" + user.getUserId() + "; RoleID: " + role.getId() );
View Full Code Here

Examples of com.dotmarketing.business.RoleAPI.loadRoleById()

    return user;
  }

  public void lockRole (String roleId) throws DotDataException, PortalException, SystemException {
    RoleAPI roleAPI = APILocator.getRoleAPI();
    Role role = roleAPI.loadRoleById(roleId);

    User user = getUser();
    String date = DateUtil.getCurrentDate();

    ActivityLogger.logInfo(getClass(), "Locking Role", "Date: " + date + "; " + "User:" + user.getUserId() + "; RoleID: " + role.getId() );
View Full Code Here

Examples of com.dotmarketing.business.RoleAPI.loadRoleById()

  }

  public void unlockRole (String roleId) throws DotDataException, PortalException, SystemException {
    RoleAPI roleAPI = APILocator.getRoleAPI();

    Role role = roleAPI.loadRoleById(roleId);

    User user = getUser();
    String date = DateUtil.getCurrentDate();

    ActivityLogger.logInfo(getClass(), "Unlocking Role", "Date:" + date + "; "+ "User:" + user.getUserId() + "; RoleID:" + role.getId() );
View Full Code Here

Examples of com.dotmarketing.business.RoleAPI.loadRoleById()

  public List<Map<String, Object>> loadRoleLayouts(String roleId) throws DotDataException {
    List<Map<String, Object>> list = new ArrayList<Map<String,Object>>();

    LayoutAPI layoutAPI = APILocator.getLayoutAPI();
    RoleAPI roleAPI = APILocator.getRoleAPI();
    Role role = roleAPI.loadRoleById(roleId);

    List<Layout> layouts = layoutAPI.loadLayoutsForRole(role);
    for(Layout l : layouts) {
      list.add(l.toMap());
    }
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.