Examples of loadRoleById()


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

  public void saveRoleLayouts(String roleId, String[] layoutIds) throws DotDataException {

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

    List<Layout> layouts = layoutAPI.loadLayoutsForRole(role);

    //Looking for removed layouts
    for(Layout l : layouts) {
View Full Code Here

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

    RoleAPI roleAPI = APILocator.getRoleAPI();
    PermissionAPI permAPI = APILocator.getPermissionAPI();
    Host systemHost = hostAPI.findSystemHost(systemUser, false);

    Role role = roleAPI.loadRoleById(roleId);

    List<Permission> perms = permAPI.getPermissionsByRole(role, true, true);

    for(Permission p : perms) {
      List<Permission> permList = permByInode.get(p.getInode());
View Full Code Here

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

        host = hostAPI.findParentHost(folder,APILocator.getUserAPI().getSystemUser(), false);
        taskMap.put("host", host.getMap());
      } else {
        taskMap.put("host", host.getMap());
      }
      Role role = roleAPI.loadRoleById(roleId);
      if(role == null)
        continue;
      taskMap.put("role", role.toMap());
      scheduled.add(taskMap);
    }
View Full Code Here

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

  }

  public Map<String, Object> getRole(String roleId) throws DotDataException, DotSecurityException, PortalException, SystemException {

    RoleAPI roleAPI = APILocator.getRoleAPI();
    return roleAPI.loadRoleById(roleId).toMap();

  }

  public Map<String, Object> getUserRole(String userId) throws DotDataException, DotSecurityException, PortalException, SystemException {
View Full Code Here

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

    HostAPI hostAPI = APILocator.getHostAPI();
    User systemUser = APILocator.getUserAPI().getSystemUser();
    String roleId = p.getRoleId();
    Map<String, Object> roleMap = roles.get(roleId);
    if(roleMap == null) {
      Role role = roleAPI.loadRoleById(roleId);
      if(role == null)
        return;
      roleMap = role.toMap();
      roles.put(role.getId(), roleMap);
      if(!inheritable) {
View Full Code Here

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

            }

            List<Role> roleList = new ArrayList<Role>();
            if ( UtilMethods.isSet( roleId ) ) {
                try {
                    Role r = rapi.loadRoleById( roleId );
                    if ( r != null ) {
                        if ( r.getId().equals( cmsAnon.getId() ) )
                            roleList.add( cmsAnon );
                        else
                            roleList.add( r );
View Full Code Here

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

    String permissionableId = (String) map.get("permissionableId");
    String roleId = (String) map.get("roleId");
    try {
      RoleAPI roleAPI = APILocator.getRoleAPI();
      Permissionable permissionable = (Permissionable) retrievePermissionable(permissionableId);
      Role role = (Role) roleAPI.loadRoleById(roleId);
      permissionAPI.cascadePermissionUnder(permissionable, role);
    } catch (DotDataException e) {
      Logger.error(this, e.getMessage(), e);
      permissionAPI.clearCache();
      throw new DotRuntimeException(e.getMessage(), e);
View Full Code Here

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

      }
    }

    //Adding missing roles
    for(String roleId : roleIds) {
      com.dotmarketing.business.Role r = roleAPI.loadRoleById(roleId);
      if(r.isEditUsers()) {
        try {
          roleAPI.addRoleToUser(r, user);
        } catch(DotDataException e) {
          ActivityLogger.logInfo(getClass(), "Error Adding User Role", "User Beign Modified:" + userId + "; "+ "Modificator User:" + currentUser.getUserId() + "; RoleID: " + r.getId() + "; Date:" + date );
View Full Code Here

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

      jsonRoles.add(jsonRoleObject);
     
      return responseResource.response(jsonRoles.toString(), cc);
     
    } else // Loads Children Roles of given Role ID
      Role role = roleAPI.loadRoleById(roleId);
     
      JSONObject jsonRoleObject = new JSONObject();
      jsonRoleObject.put("id", role.getId());
      jsonRoleObject.put("name", UtilMethods.javaScriptify(role.getName()));
      jsonRoleObject.put("locked", role.isLocked());
View Full Code Here

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

      JSONArray jsonChildren = new JSONArray();
     
      List<String> children = role.getRoleChildren();
      if(children != null) {
        for(String childId : children) {
          Role r = roleAPI.loadRoleById(childId);

          JSONObject jsonRoleChildObject = new JSONObject();
          jsonRoleChildObject.put("id", r.getId());
          jsonRoleChildObject.put("$ref", r.getId());
          jsonRoleChildObject.put("name", UtilMethods.javaScriptify(r.getName()));
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.