掲示板

Mapping for Permission

thumbnail
12年前 に Christian Schulze によって更新されました。

Mapping for Permission

Junior Member 投稿: 87 参加年月日: 09/11/19 最新の投稿
Hello,

is there a Mapping between PortletKeys and ActionKeys?

I want to add new Roles with Permission with the UpgradeProcess in a Hook with the Method:


	Map<locale, string> titleMap = new HashMap<locale, string>();
		titleMap.put(LocaleUtil.getDefault(), name);
		Role addRole = RoleLocalServiceUtil.addRole(defaultUserId, companyId, name, titleMap, description, RoleConstants.TYPE_COMMUNITY);

		long roleId = addRole.getRoleId();
		int scope = ResourceConstants.SCOPE_GROUP;
		String primKey = String.valueOf(companyId);
		String[] actionIds = { ActionKeys.ACCESS_IN_CONTROL_PANEL };
		String permissionName = PortletKeys.JOURNAL;

		if (_PERMISSIONS_USER_CHECK_ALGORITHM == 6) {
			ResourcePermissionLocalServiceUtil.setResourcePermissions(companyId, permissionName, scope, primKey, roleId, actionIds);
		}
		else {
			PermissionLocalServiceUtil.setRolePermissions(roleId, companyId, permissionName, scope, primKey, actionIds);
		}
</locale,></locale,>


But where can I get a Mapping like in the ControlPanel Define Permissions for a Role?

Regards
Chris
thumbnail
12年前 に Thiago Leão Moreira によって更新されました。

RE: Mapping for Permission

Liferay Legend 投稿: 1449 参加年月日: 07/10/10 最新の投稿
You can look inside the folder /portal/portal-impl/src/resource-actions of Liferay's source code to get an idea of this mapping.