当前位置: 首页>>代码示例>>Java>>正文


Java Person.getPrincipalName方法代码示例

本文整理汇总了Java中org.kuali.rice.kim.api.identity.Person.getPrincipalName方法的典型用法代码示例。如果您正苦于以下问题:Java Person.getPrincipalName方法的具体用法?Java Person.getPrincipalName怎么用?Java Person.getPrincipalName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.kuali.rice.kim.api.identity.Person的用法示例。


在下文中一共展示了Person.getPrincipalName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkViewAuthorization

import org.kuali.rice.kim.api.identity.Person; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void checkViewAuthorization(UifFormBase form) throws AuthorizationException {
    // if user session or view not established we cannnot authorize the view request
    View view = form.getView();
    if ((GlobalVariables.getUserSession() == null) || view == null) {
        return;
    }

    Person user = GlobalVariables.getUserSession().getPerson();
    boolean viewAuthorized = view.getAuthorizer().canOpenView(view, form, user);

    if (!viewAuthorized) {
        throw new AuthorizationException(user.getPrincipalName(), "open", view.getId(),
                "User '" + user.getPrincipalName() + "' is not authorized to open view ID: " +
                        view.getId(), null);
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:21,代码来源:ControllerServiceImpl.java

示例2: getDocumentInitiatorNetworkId

import org.kuali.rice.kim.api.identity.Person; //导入方法依赖的package包/类
/**
 * Retrieves the principal name (network id) for the document's initiator
 *
 * @return String initiator name
 */
public String getDocumentInitiatorNetworkId() {
	String initiatorNetworkId = "";
	if (getWorkflowDocument() != null) {
		String initiatorPrincipalId = getWorkflowDocument().getInitiatorPrincipalId();
		Person initiator = KimApiServiceLocator.getPersonService().getPerson(initiatorPrincipalId);
		if (initiator != null) {
			initiatorNetworkId = initiator.getPrincipalName();
		}
	}

	return initiatorNetworkId;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:18,代码来源:DocumentFormBase.java

示例3: setPerson

import org.kuali.rice.kim.api.identity.Person; //导入方法依赖的package包/类
public void setPerson(Person person) {
    this.person = person;

    if (person != null) {
        this.id = person.getPrincipalName();
        this.name = person.getName();
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:9,代码来源:AdHocRoutePerson.java

示例4: setPerson

import org.kuali.rice.kim.api.identity.Person; //导入方法依赖的package包/类
/**
 * Sets the person attribute value.
 * @param person The person to set.
 */
public void setPerson(Person person) {
    this.person = person;
    if ( person != null ) {
        principalMemberPrincipalName = person.getPrincipalName();
        principalMemberPrincipalId = person.getPrincipalId();
        principalMemberName = person.getName();
    } else {
        principalMemberPrincipalId = "";
        principalMemberPrincipalName = "";
        principalMemberName = "";
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:17,代码来源:TestReviewRole.java

示例5: populateRequestForIncidentReport

import org.kuali.rice.kim.api.identity.Person; //导入方法依赖的package包/类
public static Map<String, String> populateRequestForIncidentReport(Exception exception,
		String documentId, String componentName, HttpServletRequest request) {

	// Create properties of form and user for additional information
	// to be displayed or passing through JSP
	Map<String, String> properties = new HashMap<String, String>();
	properties.put(KualiExceptionIncident.DOCUMENT_ID, documentId);
	String userEmail = "";
	String userName = "";
	String uuid = "";
	// No specific forward for the caught exception, use default logic
	// Get user information
	UserSession userSession = (UserSession) request.getSession()
			.getAttribute(KRADConstants.USER_SESSION_KEY);
	Person sessionUser = null;
	if (userSession != null) {
		sessionUser = userSession.getPerson();
	}
	if (sessionUser != null) {
		userEmail = sessionUser.getEmailAddressUnmasked();
		userName = sessionUser.getName();
		uuid = sessionUser.getPrincipalName();
	}
	properties.put(KualiExceptionIncident.USER_EMAIL, userEmail);
	properties.put(KualiExceptionIncident.USER_NAME, userName);
	properties.put(KualiExceptionIncident.UUID, uuid);
	properties.put(KualiExceptionIncident.COMPONENT_NAME, componentName);

	// Reset the exception so the forward action can read it
	request.setAttribute(Globals.EXCEPTION_KEY, exception);
	// Set exception current information
	request.setAttribute(EXCEPTION_PROPERTIES, properties);

	return properties;

}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:37,代码来源:IncidentReportUtils.java

示例6: getIdValue

import org.kuali.rice.kim.api.identity.Person; //导入方法依赖的package包/类
public static String getIdValue(String idType, Person user) {
  if ("workflowId".equalsIgnoreCase(idType) || "w".equalsIgnoreCase(idType) || "principalId".equalsIgnoreCase(idType)) {
    return user.getPrincipalId();
  } else if ("authenticationId".equalsIgnoreCase(idType) || "a".equalsIgnoreCase(idType) || "principalName".equalsIgnoreCase(idType)) {
    return user.getPrincipalName();
  } else if ("emplId".equalsIgnoreCase(idType) || "e".equalsIgnoreCase(idType)) {
    return user.getEmployeeId();
  } else {
    LOG.error("Could not determine ID Value for given id type!" + idType);
  }
  return null;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:13,代码来源:UserUtils.java


注:本文中的org.kuali.rice.kim.api.identity.Person.getPrincipalName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。