Examples of IRoleManagement


Examples of org.palo.viewapi.internal.IRoleManagement

          xParentFolder, true, isPublic, isEditable);
        xFolderElements.add(createXFolderElement(folderElement,
          importedXView));
        List <String> roleIds = new ArrayList<String>();
        List <String> roleNames = new ArrayList<String>();
        IRoleManagement rm = MapperRegistry.getInstance().getRoleManagement();
        if (isPublic) {
          try {
            Role r = (Role) rm.findByName("VIEWER");
            roleIds.add(r.getId());
            roleNames.add(r.getName());
          } catch (Throwable t) {
          }
        }
        if (isEditable) {
          try {
            Role r = (Role) rm.findByName("EDITOR");
            roleIds.add(r.getId());
            roleNames.add(r.getName());
          } catch (Throwable t) {
          }
        }
View Full Code Here

Examples of org.palo.viewapi.internal.IRoleManagement

      e.printStackTrace();
    }

    List <String> roleIds = new ArrayList<String>();
    List <String> roleNames = new ArrayList<String>();
    IRoleManagement rm = MapperRegistry.getInstance().getRoleManagement();
    try {
      Role r = (Role) rm.findByName("VIEWER");
      roleIds.add(r.getId());
      roleNames.add(r.getName());
    } catch (Throwable t) {
    }
    try {
      Role r = (Role) rm.findByName("EDITOR");
      roleIds.add(r.getId());
      roleNames.add(r.getName());
    } catch (Throwable t) {
    }
    importedXView.setRoleIds(roleIds);
View Full Code Here

Examples of org.palo.viewapi.internal.IRoleManagement

    }
  }
 
  private final void assignViewerAndEditorRole(String sessionId, FolderElement fe, View view,
      boolean isPublic, boolean isEditable) throws SQLException {
    IRoleManagement roleMgmt = MapperRegistry.getInstance().getRoleManagement();
    Role viewerRole = (Role) roleMgmt.findByName("VIEWER");
    if (viewerRole == null) {
      viewerRole = new RoleImpl.Builder(null).name("VIEWER").
      permission(Right.READ).build();
      roleMgmt.insert(viewerRole);
    }
    Role editorRole = (Role) roleMgmt.findByName("EDITOR");
    if (editorRole == null) {
      editorRole = new RoleImpl.Builder(null).name("EDITOR").
        permission(Right.CREATE).build();
      roleMgmt.insert(editorRole);
    }
   
    if (fe != null) {
    try {
      FolderService folderService = ServiceProvider
View Full Code Here

Examples of org.palo.viewapi.internal.IRoleManagement

    return result;
  }

  private final void assignViewerAndEditorRole(String sessionId, FolderElement fe, View view,
      boolean isPublic, boolean isEditable) throws SQLException {
    IRoleManagement roleMgmt = MapperRegistry.getInstance().getRoleManagement();
    Role viewerRole = (Role) roleMgmt.findByName("VIEWER");
    if (viewerRole == null) {
      viewerRole = new RoleImpl.Builder(null).name("VIEWER").
      permission(Right.READ).build();
      roleMgmt.insert(viewerRole);
    }
    Role editorRole = (Role) roleMgmt.findByName("EDITOR");
    if (editorRole == null) {
      editorRole = new RoleImpl.Builder(null).name("EDITOR").
        permission(Right.CREATE).build();
      roleMgmt.insert(editorRole);
    }
   
    try {
      FolderService folderService = ServiceProvider
        .getFolderService(getLoggedInUser(sessionId));
View Full Code Here

Examples of org.palo.viewapi.internal.IRoleManagement

    return false;
  }

  public HashMap<String, String> initializeRoles(String sessionId)
      throws SessionExpiredException {
    IRoleManagement rm = MapperRegistry.getInstance().getRoleManagement();
    HashMap <String, String> result = new HashMap<String, String>();
    try {
      for (Role r: rm.findAll()) {
        result.put(r.getName(), r.getId());   
      }
    } catch (Throwable t) {     
    }
    return result;
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.