自定义Life ray中站点管理员角色的权限?

问题描述:

我想自定义站点管理员角色权限,即,我需要启用一项功能,以创建用于在相应站点下进行站点管理的用户.我该如何实现?我需要使用Hook来实现它还是需要创建EXT?或任何其他更简单的方法来实现这一目标? 我需要启用用户创建并为相应站点下的站点管理员分配权限.我不想通过超级管理员来创建用户.

I want to customize the Site Administrator Role permissions i.e, I need to enable a feature for creating the users for site administration under respective site. How can I achieve that? Do I need to achieve it with Hook OR need to create EXT? OR any other simpler way to achieve that? I need to enable the user creation and assign permission for Site Administrator under respective site. I don't want to crate users by Super admin.

也许您可以创建一个自定义portlet,将其放在控制面板中,在该面板中,只有站点管理员(填写表单)才能创建您直接分配的用户,当前站点的成员.

Maybe you can create a custom portlet, put it in control panel, in which only the Site Administrators, filling a form, can create users that you assign directly as members of current site.

专业版: 我认为您可以完成任务.

PRO: I think you can achieve your task.

CON:

  • 您必须花时间进行开发,这不是单击几下即可解决的问题".
  • 这不是权限"自定义项.

参考: 开始Liferay开发" 这是一个有用的指南,它使用所有Liferay最佳实践来解释如何开发完整的portlet,即著名的"

References: "Beginning Liferay Development" It's a usefull guide that explain, using all Liferay best practice, how to develop a complete portlet, the "famous" KnowledgeBasePortlet. I suggest you to read it all, but the important points for your problem are:

  • 设置权限,仅允许站点管理员创建用户
  • 将Portlet添加到控制面板
  • Setting Permissions, to permit only to Site Administrator to create Users
  • Adding Portlet to Control Panel

注意: 如您将看到的(创建实体动作),KnowledgeBasePortlet创建了两个自定义实体,您不需要这样做:您需要的实体已经存在.使用该章只是为了了解如何调用添加/编辑/删除实体的方法,您将必须通过UserLocalServiceUtil对用户实体进行相同的操作.

NB: As you will see (Creating Entity Actions), the KnowledgeBasePortlet creates two custom Entities, you don't need to do it: the entities you need already exist. Use that chapter just to learn how call the methods to add/edit/delete that entities, you will have to do the same but with the User entity through the UserLocalServiceUtil.