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


Java ThemeDisplay.getPermissionChecker方法代码示例

本文整理汇总了Java中com.liferay.portal.theme.ThemeDisplay.getPermissionChecker方法的典型用法代码示例。如果您正苦于以下问题:Java ThemeDisplay.getPermissionChecker方法的具体用法?Java ThemeDisplay.getPermissionChecker怎么用?Java ThemeDisplay.getPermissionChecker使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.liferay.portal.theme.ThemeDisplay的用法示例。


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

示例1: upmodule

import com.liferay.portal.theme.ThemeDisplay; //导入方法依赖的package包/类
public void upmodule(ActionRequest actionRequest, ActionResponse actionResponse)
throws Exception {

	long moduleId = ParamUtil.getLong(actionRequest, "resId",0);
	ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
	PermissionChecker permissionChecker=themeDisplay.getPermissionChecker();
	long userIdAction = themeDisplay.getUserId();
	if(moduleId>0)
	{
		if(permissionChecker.hasPermission(
	
			themeDisplay.getScopeGroupId(),
			Module.class.getName(), moduleId,
			ActionKeys.UPDATE))
		{
			ModuleLocalServiceUtil.goUpModule(moduleId, userIdAction);
		}
	}
	
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:21,代码来源:LmsActivitiesList.java

示例2: downmodule

import com.liferay.portal.theme.ThemeDisplay; //导入方法依赖的package包/类
public void downmodule(ActionRequest actionRequest, ActionResponse actionResponse)
throws Exception {
	ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
	PermissionChecker permissionChecker=themeDisplay.getPermissionChecker();
	
	long moduleId = ParamUtil.getLong(actionRequest, "resId",0);
	long userIdAction = themeDisplay.getUserId();
	if(moduleId>0)
	{
		if(permissionChecker.hasPermission(
			themeDisplay.getScopeGroupId(),
			Module.class.getName(), moduleId,
			ActionKeys.UPDATE))
		{
		ModuleLocalServiceUtil.goDownModule(moduleId,userIdAction);
		}
	}
	
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:20,代码来源:LmsActivitiesList.java

示例3: moveModule

import com.liferay.portal.theme.ThemeDisplay; //导入方法依赖的package包/类
public void moveModule(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
	
	ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
	PermissionChecker permissionChecker=themeDisplay.getPermissionChecker();
	long userIdAction = themeDisplay.getUserId();
	long moduleId = ParamUtil.getLong(actionRequest, "pageId"),
	     prevModId = ParamUtil.getLong(actionRequest, "prevPageId"),
	     nextModId = ParamUtil.getLong(actionRequest, "nextPageId");
	
	if(moduleId>0){
		if(permissionChecker.hasPermission(themeDisplay.getScopeGroupId(), Module.class.getName(), moduleId, ActionKeys.UPDATE)){
			ModuleLocalServiceUtil.moveModule(moduleId, prevModId, nextModId,userIdAction);
		}
	}
	
	actionResponse.setRenderParameter("jsp", "/html/lmsactivitieslist/view.jsp");
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:18,代码来源:LmsActivitiesList.java

示例4: moveActivity

import com.liferay.portal.theme.ThemeDisplay; //导入方法依赖的package包/类
public void moveActivity(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
	
	ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
	PermissionChecker permissionChecker=themeDisplay.getPermissionChecker();
	
	long actId = ParamUtil.getLong(actionRequest, "pageId"),
	     prevActId = ParamUtil.getLong(actionRequest, "prevPageId"),
	     nextActId = ParamUtil.getLong(actionRequest, "nextPageId");
	
	if(actId>0){
		LearningActivity larn = LearningActivityLocalServiceUtil.getLearningActivity(actId);
		
		if(permissionChecker.hasPermission(larn.getGroupId(), LearningActivity.class.getName(), larn.getActId(), ActionKeys.UPDATE)|| 
				permissionChecker.hasOwnerPermission(larn.getCompanyId(), LearningActivity.class.getName(), larn.getActId(),larn.getUserId(), ActionKeys.UPDATE)){
			LearningActivityLocalServiceUtil.moveActivity(actId, prevActId, nextActId, themeDisplay.getUserId());
		}
	}
	
	actionResponse.setRenderParameter("jsp", "/html/lmsactivitieslist/view.jsp");
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:21,代码来源:LmsActivitiesList.java

示例5: upquestion

import com.liferay.portal.theme.ThemeDisplay; //导入方法依赖的package包/类
public void upquestion(ActionRequest actionRequest, ActionResponse actionResponse)
throws Exception {
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
	
	PermissionChecker permissionChecker=themeDisplay.getPermissionChecker();
	
	long actId = ParamUtil.getLong(actionRequest, "actId",0);
	long testQuestionId = ParamUtil.getLong(actionRequest, "questionId");
	
	if(actId>0)
	{	
		LearningActivity larn = LearningActivityLocalServiceUtil.getLearningActivity(actId);
	
		if(permissionChecker.hasPermission(larn.getGroupId(), LearningActivity.class.getName(), larn.getActId(),
				ActionKeys.UPDATE)|| permissionChecker.hasOwnerPermission(larn.getCompanyId(), LearningActivity.class.getName(), larn.getActId(),larn.getUserId(),
						ActionKeys.UPDATE))
		{
		TestQuestionLocalServiceUtil.goUpTestQuestion(testQuestionId);
		}
	}
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:22,代码来源:ExecActivity.java

示例6: downquestion

import com.liferay.portal.theme.ThemeDisplay; //导入方法依赖的package包/类
public void downquestion(ActionRequest actionRequest, ActionResponse actionResponse)
throws Exception {
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
	
	PermissionChecker permissionChecker=themeDisplay.getPermissionChecker();
	
	long actId = ParamUtil.getLong(actionRequest, "actId",0);
	long testQuestionId = ParamUtil.getLong(actionRequest, "questionId");

	if(actId>0)
	{
		LearningActivity larn = LearningActivityLocalServiceUtil.getLearningActivity(actId);
		
		if(permissionChecker.hasPermission(larn.getGroupId(), LearningActivity.class.getName(), larn.getActId(),
				ActionKeys.UPDATE)|| permissionChecker.hasOwnerPermission(larn.getCompanyId(), LearningActivity.class.getName(), larn.getActId(),larn.getUserId(),
						ActionKeys.UPDATE))
		{
			TestQuestionLocalServiceUtil.goDownTestQuestion(testQuestionId);
		}
	}
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:22,代码来源:ExecActivity.java

示例7: upquestion

import com.liferay.portal.theme.ThemeDisplay; //导入方法依赖的package包/类
public void upquestion(ActionRequest actionRequest, ActionResponse actionResponse)
		throws Exception {
	ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);

	PermissionChecker permissionChecker=themeDisplay.getPermissionChecker();

	long actId = ParamUtil.getLong(actionRequest, "actId",0);
	long testQuestionId = ParamUtil.getLong(actionRequest, "questionId");

	if(actId>0)
	{	
		LearningActivity larn = LearningActivityLocalServiceUtil.getLearningActivity(actId);

		if(permissionChecker.hasPermission(larn.getGroupId(), LearningActivity.class.getName(), larn.getActId(),
				ActionKeys.UPDATE)|| permissionChecker.hasOwnerPermission(larn.getCompanyId(), LearningActivity.class.getName(), larn.getActId(),larn.getUserId(),
						ActionKeys.UPDATE))
		{
			TestQuestionLocalServiceUtil.goUpTestQuestion(testQuestionId);
		}
	}
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:22,代码来源:SurveyActivity.java

示例8: downquestion

import com.liferay.portal.theme.ThemeDisplay; //导入方法依赖的package包/类
public void downquestion(ActionRequest actionRequest, ActionResponse actionResponse)
		throws Exception {
	ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);

	PermissionChecker permissionChecker=themeDisplay.getPermissionChecker();

	long actId = ParamUtil.getLong(actionRequest, "actId",0);
	long testQuestionId = ParamUtil.getLong(actionRequest, "questionId");

	if(actId>0)
	{
		LearningActivity larn = LearningActivityLocalServiceUtil.getLearningActivity(actId);

		if(permissionChecker.hasPermission(larn.getGroupId(), LearningActivity.class.getName(), larn.getActId(),
				ActionKeys.UPDATE)|| permissionChecker.hasOwnerPermission(larn.getCompanyId(), LearningActivity.class.getName(), larn.getActId(),larn.getUserId(),
						ActionKeys.UPDATE))
		{
			TestQuestionLocalServiceUtil.goDownTestQuestion(testQuestionId);
		}
	}
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:22,代码来源:SurveyActivity.java

示例9: hasPermissionInPortlet

import com.liferay.portal.theme.ThemeDisplay; //导入方法依赖的package包/类
public static boolean hasPermissionInPortlet(PortletRequest request,String action) throws SystemException,PortalException
{
	ThemeDisplay themeDisplay = getThemeDisplay(request);		
	PortletPermission portletPermission = PortletPermissionUtil.getPortletPermission();			
	PermissionChecker permissionChecker = themeDisplay.getPermissionChecker();	
	long plid = themeDisplay.getLayout().getPlid();  // http://www.liferay.com/community/forums/-/message_boards/message/1224284
	String porletDispId = getPortletDisplayId(request,themeDisplay);
	return portletPermission.contains(permissionChecker,plid,porletDispId,action);
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:10,代码来源:LiferayViewUtil.java

示例10: hasPermission

import com.liferay.portal.theme.ThemeDisplay; //导入方法依赖的package包/类
public static boolean hasPermission(long groupId, String name, String primKey, String actionId, ThemeDisplay themeDisplay) {
	
	PermissionChecker permissionChecker = themeDisplay.getPermissionChecker();
	if (permissionChecker.hasPermission(
			groupId, name, primKey, actionId)) {
		
		return true;
	}
	
	return false;
}
 
开发者ID:craigvershaw,项目名称:link-scanner,代码行数:12,代码来源:LinkScannerUtil.java

示例11: deletemodule

import com.liferay.portal.theme.ThemeDisplay; //导入方法依赖的package包/类
public void deletemodule(ActionRequest actionRequest, ActionResponse actionResponse)throws Exception{

		log.debug("*******deletemodule*********");
		
		actionResponse.removePublicRenderParameter("actionEditingActivity");
		actionResponse.removePublicRenderParameter("actionEditingModule");
		
		long moduleId = ParamUtil.getLong(actionRequest, "resId",0);
		long renderModule = ParamUtil.getLong(actionRequest, "moduleId",0);
		ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
		PermissionChecker permissionChecker=themeDisplay.getPermissionChecker();
		Module rendModule = ModuleLocalServiceUtil.getPreviusModule(moduleId);
		if(Validator.isNull(rendModule)){
			rendModule=ModuleLocalServiceUtil.getNextModule(moduleId);
		}
		if(moduleId>0){
			if(permissionChecker.hasPermission(
					themeDisplay.getScopeGroupId(),
					Module.class.getName(), moduleId,
					ActionKeys.DELETE))
			{
				
				List<LearningActivity> moduleActivities = LearningActivityLocalServiceUtil.getLearningActivitiesOfModule(moduleId);
				for(LearningActivity la : moduleActivities){
					deleteActivity(la, themeDisplay, actionRequest, actionResponse);
				}
				
				ModuleLocalServiceUtil.deleteModule(moduleId);
				SessionMessages.add(actionRequest, "ok-delete-module");
				if(moduleId==renderModule){
					List<LearningActivity> activities = LearningActivityLocalServiceUtil.getLearningActivitiesOfModule(rendModule.getModuleId());
					if(activities!=null && activities.size()>0){
						actionResponse.setRenderParameter("actId", String.valueOf(activities.get(0).getActId()));
						actionResponse.setRenderParameter("resId", String.valueOf(activities.get(0).getActId()));
					}else{
						actionResponse.setRenderParameter("actId", "0");
						actionResponse.setRenderParameter("resId", "0");
					}					
					actionResponse.setRenderParameter("moduleId", String.valueOf(rendModule.getModuleId()));
					
				}							
			}
		}
	}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:45,代码来源:LmsActivitiesList.java

示例12: deleteactivity

import com.liferay.portal.theme.ThemeDisplay; //导入方法依赖的package包/类
public void deleteactivity(ActionRequest actionRequest, ActionResponse actionResponse)
	throws Exception {

	long actId = ParamUtil.getLong(actionRequest, "resId");
	long renderActId = ParamUtil.getLong(actionRequest, "actId",0);
	long moduleId = ParamUtil.getLong(actionRequest, "moduleId", 0);

	ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);

	PermissionChecker permissionChecker=themeDisplay.getPermissionChecker();

	log.debug("*****deleteactivity*****");
	
	actionResponse.removePublicRenderParameter("actionEditingActivity");
	actionResponse.removePublicRenderParameter("actionEditingModule");
	
	if(actId>0){
		LearningActivity larn = LearningActivityLocalServiceUtil.getLearningActivity(actId);
		if(moduleId<=0){
			moduleId = larn.getModuleId();
		}
		if(permissionChecker.hasPermission(larn.getGroupId(), LearningActivity.class.getName(), larn.getActId(),
				ActionKeys.DELETE)|| permissionChecker.hasOwnerPermission(larn.getCompanyId(), LearningActivity.class.getName(), larn.getActId(),larn.getUserId(),
						ActionKeys.DELETE))
		{
			deleteActivity(larn,themeDisplay,actionRequest,actionResponse);
			SessionMessages.add(actionRequest, "ok-deleteActivity");
			if(actId==renderActId) {
				List<LearningActivity> activities = LearningActivityLocalServiceUtil.getLearningActivitiesOfModule(moduleId);
				actionResponse.removePublicRenderParameter("actId");		
				if(activities!=null && activities.size()>0){
					actionResponse.setRenderParameter("actId", String.valueOf(activities.get(0).getActId()));
					actionResponse.setRenderParameter("resId", String.valueOf(activities.get(0).getActId()));
				}else{
					actionResponse.setRenderParameter("actId", "0");
					actionResponse.setRenderParameter("resId", "0");
					actionResponse.setRenderParameter("moduleId", String.valueOf(moduleId));
				}
			}
			
			/*
			if(!LiferayWindowState.EXCLUSIVE.equals(actionRequest.getWindowState())){
				actionResponse.sendRedirect(
						((LiferayPortletResponse)actionResponse).createRenderURL().toString());
				
			}
			*/
		}
	}

}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:52,代码来源:LmsActivitiesList.java

示例13: serveResource

import com.liferay.portal.theme.ThemeDisplay; //导入方法依赖的package包/类
public void serveResource(ResourceRequest request, ResourceResponse response) throws PortletException,IOException{
	
	ThemeDisplay themeDisplay = (ThemeDisplay)request.getAttribute(WebKeys.THEME_DISPLAY);
	
	long actId = ParamUtil.getLong(request, "actId");
	String action = ParamUtil.getString(request, "action");

	log.error("Act ID "+actId);
	PermissionChecker permissionChecker=themeDisplay.getPermissionChecker();
	JSONObject oreturned = JSONFactoryUtil.createJSONObject();	
	boolean changed=false;
	if(actId>0)
	{	
		try{
			LearningActivity larn = LearningActivityLocalServiceUtil.getLearningActivity(actId);
			if(permissionChecker.hasPermission(larn.getGroupId(), LearningActivity.class.getName(), larn.getActId(),
					ActionKeys.UPDATE)|| permissionChecker.hasOwnerPermission(larn.getCompanyId(), LearningActivity.class.getName(), larn.getActId(),larn.getUserId(),
							ActionKeys.UPDATE))
			{
				if(action.equals("down")){
					LearningActivityLocalServiceUtil.goDownLearningActivity(actId, themeDisplay.getUserId());
					changed=true;	
				}else if(action.equals("up")){
					LearningActivityLocalServiceUtil.goUpLearningActivity(actId, themeDisplay.getUserId());
					changed=true;
				}
				
			}								
		}catch(Exception e){
			e.printStackTrace();
			throw new PortletException(e.getMessage());
		}
	}
	if(changed){
		oreturned.put("success", "OK");
		PrintWriter out = response.getWriter();
		out.print(oreturned.toString());
		out.flush();
		out.close();
	}
	
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:43,代码来源:LmsActivitiesList.java

示例14: moveQuestion

import com.liferay.portal.theme.ThemeDisplay; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public void moveQuestion(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
	
	ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
	PermissionChecker permissionChecker=themeDisplay.getPermissionChecker();
	
	long questionId = ParamUtil.getLong(actionRequest, "pageId"),
	     prevQuestionId = ParamUtil.getLong(actionRequest, "prevPageId"),
	     nextQuestionId = ParamUtil.getLong(actionRequest, "nextPageId");
	TestQuestion question = TestQuestionLocalServiceUtil.getTestQuestion(questionId);
	if(questionId>0){
		if(permissionChecker.hasPermission(themeDisplay.getScopeGroupId(), LearningActivity.class.getName(), questionId, ActionKeys.UPDATE)){
			TestQuestionLocalServiceUtil.moveQuestion(questionId, prevQuestionId, nextQuestionId);
		}
	}
	
	String orderByCol = ParamUtil.getString(actionRequest, "orderByCol");
       if(orderByCol==null || orderByCol=="")
           orderByCol = "weight";
       actionRequest.setAttribute("orderByCol", orderByCol);
       //Create an instance of BeanComparator telling it wich is the order column
       //Get the type of ordering, asc or desc
       String orderByType = ParamUtil.getString(actionRequest, "orderByType");
       	if(orderByType==null || orderByType=="")
       		orderByType = "asc";
       	actionRequest.setAttribute("orderByType", orderByType);
       	TestQuestion questions = TestQuestionLocalServiceUtil.getTestQuestion(questionId);
       	List<TestQuestion> listaAux = TestQuestionLocalServiceUtil.getQuestions(questions.getActId());
       	List<TestQuestion> listaTotal = new LinkedList<TestQuestion>();
       	listaTotal = ListUtil.copy(listaAux);
       	//Sort
           BeanComparator beanComparator = new BeanComparator(orderByCol);
       	if(orderByType.equals("asc")){
       		Collections.sort(listaTotal, beanComparator);
		 } 
       	else {
       		Collections.sort(listaTotal, Collections.reverseOrder(beanComparator));
		 }
	//Return the orderer list
	actionRequest.setAttribute("total", listaTotal.size());
	actionRequest.setAttribute("listaAux", listaTotal);
	actionResponse.setRenderParameter("actionEditingDetails", StringPool.TRUE);
	actionResponse.setRenderParameter("resId", Long.toString(question.getActId()));
	actionResponse.setRenderParameter("jsp", "/html/execactivity/test/admin/orderQuestions.jsp");
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:46,代码来源:ExecActivity.java

示例15: moveQuestion

import com.liferay.portal.theme.ThemeDisplay; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public void moveQuestion(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {

	ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
	PermissionChecker permissionChecker=themeDisplay.getPermissionChecker();

	long questionId = ParamUtil.getLong(actionRequest, "pageId"),
			prevQuestionId = ParamUtil.getLong(actionRequest, "prevPageId"),
			nextQuestionId = ParamUtil.getLong(actionRequest, "nextPageId");
	TestQuestion question = TestQuestionLocalServiceUtil.getTestQuestion(questionId);
	if(questionId>0){
		if(permissionChecker.hasPermission(themeDisplay.getScopeGroupId(), LearningActivity.class.getName(), questionId, ActionKeys.UPDATE)){
			TestQuestionLocalServiceUtil.moveQuestion(questionId, prevQuestionId, nextQuestionId);
		}
	}

	String orderByCol = ParamUtil.getString(actionRequest, "orderByCol");
	if(orderByCol==null || orderByCol=="")
		orderByCol = "weight";
	actionRequest.setAttribute("orderByCol", orderByCol);
	//Create an instance of BeanComparator telling it wich is the order column
	//Get the type of ordering, asc or desc
	String orderByType = ParamUtil.getString(actionRequest, "orderByType");
	if(orderByType==null || orderByType=="")
		orderByType = "asc";
	actionRequest.setAttribute("orderByType", orderByType);
	TestQuestion questions = TestQuestionLocalServiceUtil.getTestQuestion(questionId);
	List<TestQuestion> listaAux = TestQuestionLocalServiceUtil.getQuestions(questions.getActId());
	List<TestQuestion> listaTotal = new LinkedList<TestQuestion>();
	listaTotal = ListUtil.copy(listaAux);
	//Sort
	BeanComparator beanComparator = new BeanComparator(orderByCol);
	if(orderByType.equals("asc")){
		Collections.sort(listaTotal, beanComparator);
	} 
	else {
		Collections.sort(listaTotal, Collections.reverseOrder(beanComparator));
	}
	//Return the orderer list
	actionRequest.setAttribute("total", listaTotal.size());
	actionRequest.setAttribute("listaAux", listaTotal);
	actionResponse.setRenderParameter("actionEditingDetails", StringPool.TRUE);
	actionResponse.setRenderParameter("resId", Long.toString(question.getActId()));
	actionResponse.setRenderParameter("jsp", "/html/surveyactivity/admin/orderQuestions.jsp");
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:46,代码来源:SurveyActivity.java


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