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


Java ActionKeys类代码示例

本文整理汇总了Java中com.liferay.portal.security.permission.ActionKeys的典型用法代码示例。如果您正苦于以下问题:Java ActionKeys类的具体用法?Java ActionKeys怎么用?Java ActionKeys使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: areThereTriesNotFromEditors

import com.liferay.portal.security.permission.ActionKeys; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public boolean areThereTriesNotFromEditors(LearningActivity activity) throws Exception
{ 		
	boolean resp = false;
	List<User> users = getUsersByLearningActivity(activity.getActId());
	for(User usu:users){
		PermissionChecker permissionChecker = PermissionCheckerFactoryUtil.create(usu);
		if(!(permissionChecker.hasPermission(activity.getGroupId(),"com.liferay.lms.model",activity.getGroupId(),"UPDATE_ACTIVE")||
				permissionChecker.hasPermission(activity.getGroupId(),LearningActivity.class.getName(),activity.getActId(),ActionKeys.UPDATE)||
				permissionChecker.hasOwnerPermission(activity.getCompanyId(),LearningActivity.class.getName(),activity.getActId(),activity.getUserId(),ActionKeys.UPDATE))){
			resp = true;
			break;
		}
	}
	return resp;		
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:17,代码来源:LearningActivityTryLocalServiceImpl.java

示例2: getVisibleActivities

import com.liferay.portal.security.permission.ActionKeys; //导入依赖的package包/类
public static List<LearningActivity> getVisibleActivities(ThemeDisplay themeDisplay,
		List<LearningActivity> res, PermissionChecker permissionChecker)
		throws PortalException, SystemException {
	List<LearningActivity> res2 = null;
	if(res != null && res.size()>0){
		res2 = new ArrayList<LearningActivity>();
		res2.addAll(res);
		Role siteMemberRole = RoleLocalServiceUtil.getRole(themeDisplay.getCompanyId(), RoleConstants.SITE_MEMBER);
		for(java.util.ListIterator<LearningActivity> itr = res2.listIterator(); itr.hasNext();){
			LearningActivity activity = itr.next();
			try {
				if(!ResourcePermissionLocalServiceUtil.hasResourcePermission(activity.getCompanyId(), LearningActivity.class.getName(), 
						ResourceConstants.SCOPE_INDIVIDUAL,	Long.toString(activity.getActId()),siteMemberRole.getRoleId(), ActionKeys.VIEW)
						&& !permissionChecker.hasPermission(activity.getGroupId(), LearningActivity.class.getName(), activity.getActId() , "CORRECT"))
					itr.remove();
			} catch (SystemException e) {
				e.printStackTrace();
			}
		}
	}
	return res2;
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:23,代码来源:LiferaylmsUtil.java

示例3: upmodule

import com.liferay.portal.security.permission.ActionKeys; //导入依赖的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

示例4: downmodule

import com.liferay.portal.security.permission.ActionKeys; //导入依赖的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

示例5: moveModule

import com.liferay.portal.security.permission.ActionKeys; //导入依赖的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

示例6: moveActivity

import com.liferay.portal.security.permission.ActionKeys; //导入依赖的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

示例7: upquestion

import com.liferay.portal.security.permission.ActionKeys; //导入依赖的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

示例8: downquestion

import com.liferay.portal.security.permission.ActionKeys; //导入依赖的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

示例9: upquestion

import com.liferay.portal.security.permission.ActionKeys; //导入依赖的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

示例10: downquestion

import com.liferay.portal.security.permission.ActionKeys; //导入依赖的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

示例11: deleteLearningactivity

import com.liferay.portal.security.permission.ActionKeys; //导入依赖的package包/类
public void deleteLearningactivity (LearningActivity lernact) throws SystemException,
PortalException {
	if( getPermissionChecker().hasPermission(lernact.getGroupId(), LearningActivity.class.getName(), lernact.getActId(),
			ActionKeys.DELETE))
	{
		learningActivityLocalService.deleteLearningactivity(lernact);

		//auditing
		if(lernact!=null){
			AuditingLogFactory.audit(lernact.getCompanyId(), lernact.getGroupId(), Course.class.getName(), lernact.getPrimaryKey(), lernact.getUserId(), AuditConstants.DELETE, null);
			SocialActivityLocalServiceUtil.addActivity(getUserId(), lernact.getGroupId(), LearningActivity.class.getName(), lernact.getActId(), com.liferay.lms.social.LearningActivityKeys.DELETE_ENTRY, "", lernact.getUserId());
			
		}
		
	}
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:17,代码来源:LearningActivityServiceImpl.java

示例12: addLearningActivity

import com.liferay.portal.security.permission.ActionKeys; //导入依赖的package包/类
public LearningActivity addLearningActivity (String title, String description, java.util.Date createDate,java.util.Date startDate,java.util.Date endDate, int typeId,long tries,int passpuntuation,long moduleId,
		ServiceContext serviceContext)
		throws SystemException, 
		PortalException {
	if( getPermissionChecker().hasPermission(serviceContext.getScopeGroupId(),  LearningActivity.class.getName(),0,ActionKeys.ADD_ENTRY))
	{
		LearningActivity lernact = learningActivityLocalService.addLearningActivity(title, description, createDate, startDate, endDate, typeId, tries, passpuntuation,moduleId, "",  null, null, serviceContext);

		//auditing
		if(lernact!=null){
			AuditingLogFactory.audit(lernact.getCompanyId(), lernact.getGroupId(), Course.class.getName(), lernact.getPrimaryKey(), lernact.getUserId(), AuditConstants.ADD, null);
			SocialActivityLocalServiceUtil.addActivity(serviceContext.getUserId(), lernact.getGroupId(), LearningActivity.class.getName(), lernact.getActId(), com.liferay.lms.social.LearningActivityKeys.ADD_ENTRY, "", lernact.getUserId());
			
		}
		
		return lernact;
	}
	else
	{
		return null;
	}
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:23,代码来源:LearningActivityServiceImpl.java

示例13: modLearningActivity

import com.liferay.portal.security.permission.ActionKeys; //导入依赖的package包/类
public LearningActivity modLearningActivity (LearningActivity lernact, 
		ServiceContext serviceContext)
		throws SystemException, PortalException {
	if( getPermissionChecker().hasPermission(lernact.getGroupId(), LearningActivity.class.getName(), lernact.getActId(),
			ActionKeys.UPDATE))
	{
		lernact =  learningActivityLocalService.modLearningActivity(lernact, serviceContext);
		
		//auditing
		if(lernact!=null){
			AuditingLogFactory.audit(lernact.getCompanyId(), lernact.getGroupId(), Course.class.getName(), lernact.getPrimaryKey(), lernact.getUserId(), AuditConstants.UPDATE, null);
			SocialActivityLocalServiceUtil.addActivity(serviceContext.getUserId(), lernact.getGroupId(), LearningActivity.class.getName(), lernact.getActId(), com.liferay.lms.social.LearningActivityKeys.UPDATE_ENTRY, "", lernact.getUserId());
			
		}
	
		return lernact;
	}
	else
	{
		return null;
	}
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:23,代码来源:LearningActivityServiceImpl.java

示例14: updateUser

import com.liferay.portal.security.permission.ActionKeys; //导入依赖的package包/类
@JSONWebService
public void updateUser(String login, String firstName,String lastName,String email) throws PortalException, SystemException
{
	ServiceContext serviceContext = ServiceContextThreadLocal.getServiceContext();
	
		User user = UserLocalServiceUtil.getUserByScreenName(
				serviceContext.getCompanyId(), login);
		user.setFirstName(firstName);
		user.setLastName(lastName);
		user.setEmailAddress(email);
		List<UserGroup> userGroups = user.getUserGroups();
		long[] userArray = new long[] { user.getUserId() };
		if(PortalPermissionUtil.contains(
				getPermissionChecker(), ActionKeys.ADD_USER))
		{
			UserLocalServiceUtil.updateUser(user);
		}

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

示例15: deleteExportedCourse

import com.liferay.portal.security.permission.ActionKeys; //导入依赖的package包/类
public void deleteExportedCourse(ActionRequest actionRequest, ActionResponse actionResponse) throws IOException {
	ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
	long groupId  = ParamUtil.getLong(actionRequest, "groupId", 0);
	String fileName = ParamUtil.getString(actionRequest, "fileName", StringPool.BLANK);
	String redirect = ParamUtil.getString(actionRequest, "redirect", StringPool.BLANK);
	File f = new File(PropsUtil.get("liferay.home")+"/data/lms_exports/courses/"+themeDisplay.getCompanyId()+"/"+groupId+"/"+fileName);
	if (themeDisplay.getPermissionChecker().hasPermission(groupId, Course.class.getName(), groupId, ActionKeys.DELETE) && f != null && f.isFile()) {
		FileUtil.delete(f);
		SessionMessages.add(actionRequest, "courseadmin.delete.exported.confirmation.success");
	} else {
		SessionMessages.add(actionRequest, "courseadmin.delete.exported.confirmation.error");
	}
	if (Validator.isNotNull(redirect)) {
		actionResponse.sendRedirect(redirect);
	}
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:17,代码来源:CourseAdmin.java


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