Package com.centraview.administration.authorization

Examples of com.centraview.administration.authorization.Authorization


        userObject = remote.getUserObject(individualId, firstName, lastName, userType);
        userObject.setLoginName(username);

        // In a certain case we will need a blank rights matrix, so prepare the remote connection now.
        AuthorizationHome ah = (AuthorizationHome)CVUtility.getHomeObject("com.centraview.administration.authorization.AuthorizationHome","Authorization");
        Authorization authorizationRemote = ah.create();
        authorizationRemote.setDataSource(dataSource);

        if (remember.equals("on")) {
          // the "Remember Me" cookie contains the a string in the format
          // "<userName>/<password>". This string is then encrypted.
          // We should probably store the SHA1 of the password, this is a major security risk!!
          // TODO: encode the SHA1 of the password in the cookie content, and not the password itself.
          // and write the corresponding login method to take the SHA1 directly.
          String cookieContent = username + "/" + password;
          String encodedString = Base64.encode(cookieContent.getBytes());
          Cookie rememberMeCookie = new Cookie("CVRMID", encodedString);
          // set the expire time - to the largest int possible
          rememberMeCookie.setMaxAge(2147483647);
          rememberMeCookie.setPath("/");
          response.addCookie(rememberMeCookie);
        }

        // get the real mfrm and put it on the UserObject
        mfrm = authorizationRemote.getUserSecurityProfileMatrix(individualId);
        up = userObject.getUserPref();
        up.setModuleAuthorizationMatrix(mfrm);
        userObject.setUserPref(up);
        session.setAttribute("userobject",userObject);
View Full Code Here


      boolean editFlag = false;
      if (kVO.getStatus() != null && kVO.getStatus().equals("PUBLISH")) {
        AuthorizationHome homeAuthorization = (AuthorizationHome)CVUtility.getHomeObject(
            "com.centraview.administration.authorization.AuthorizationHome", "Authorization");
        try {
          Authorization remoteAuthorization = homeAuthorization.create();
          remoteAuthorization.setDataSource(dataSource);
          editFlag = remoteAuthorization.canPerformRecordOperation(individualID, "KnowledgeBase",
              kbId, ModuleFieldRightMatrix.UPDATE_RIGHT);
        } catch (Exception e) {
          logger.error("[Exception] [ViewKnowledgebaseHandler.execute Calling Authorization]  ", e);
        }
      } else if (individualID == ownerID) {
View Full Code Here

      try
      {
        // check to see if the user has the right to update this record
        AuthorizationHome authHome = (AuthorizationHome)CVUtility.getHomeObject("com.centraview.administration.authorization.AuthorizationHome", "Authorization");
        Authorization authRemote = (Authorization)authHome.create();
       
        if (! authRemote.canPerformRecordOperation(individualID, "Individual", contactID, 10))
        {
          writer.print("FAIL: You do not have permission to delete this record.");
          return(null);
        }
      }catch(Exception e){
View Full Code Here

      remote.setDataSource(dataSource);

      try {
        // check to see if the user has the right to update this record
        AuthorizationHome authHome = (AuthorizationHome)CVUtility.getHomeObject("com.centraview.administration.authorization.AuthorizationHome", "Authorization");
        Authorization authRemote = (Authorization)authHome.create();
       
        if (! authRemote.canPerformRecordOperation(individualID, "Individual", contactID, 20)) {
          return(null);
        }
      }catch(Exception e){
        System.out.println("[Exception][SyncContactEdit] Exception thrown in editContact(2): " + e);
        //e.printStackTrace();
View Full Code Here

public class AdvancedSearchUtil {
  private static Logger logger = Logger.getLogger(AdvancedSearchUtil.class);

  public static String getModuleId(String moduleName, String dataSource) throws Exception
  {
    Authorization remoteAuthorization = null;
    try {
      AuthorizationHome AuthorizationHome = (AuthorizationHome) CVUtility.getHomeObject(
          "com.centraview.administration.authorization.AuthorizationHome", "Authorization");
      remoteAuthorization = AuthorizationHome.create();
      remoteAuthorization.setDataSource(dataSource);
    } catch (Exception e) {
      logger.error("[getModuleId]: Exception getting EJB connection.", e);
      throw new Exception(e);
    }

    String moduleId = remoteAuthorization.getModuleIdByPrimaryTable(moduleName);
    return moduleId;
  } // end getModuleId
View Full Code Here

        try {

          AuthorizationHome aa = (AuthorizationHome)CVUtility.getHomeObject(
              "com.centraview.administration.authorization.AuthorizationHome", "Authorization");
          Authorization remote = (Authorization)aa.create();
          remote.setDataSource(this.dataSource);

          returnDL = remote.getSecurityProfileList(userID, hm);

        } catch (Exception e) {
          System.out.println("[Exception][MarketingListEJB] Exception thrown in x: " + e);
        }
View Full Code Here

    hm.put("sortType", new Character(paramDL.getSortType()));

    try {
      AuthorizationHome aa = (AuthorizationHome)CVUtility.getHomeObject(
          "com.centraview.administration.authorization.AuthorizationHome", "Authorization");
      Authorization remote = (Authorization)aa.create();
      remote.setDataSource(this.dataSource);
      returnDL = remote.getSecurityProfileList(userid, hm);

    } catch (Exception e) {
      System.out.println("[Exception][MarketingListEJB] Exception thrown in x: " + e);
    }
View Full Code Here

TOP

Related Classes of com.centraview.administration.authorization.Authorization

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.