Foren
[Solved] Migration of Permission
Mati Khan, geändert vor 13 Jahren.
[Solved] Migration of Permission
Junior Member Beiträge: 25 Beitrittsdatum: 01.11.10 Neueste Beiträge
Hi,
I have created an organization, an organization role with specific permissions, and a user using liferay 6.0.5 control panel.
It was all on my test environment. Now I want to have a same things on production environment. Can anybody tell me the correct way of migration or copying all the things between two liferay enviroments.
I have created an organization, an organization role with specific permissions, and a user using liferay 6.0.5 control panel.
It was all on my test environment. Now I want to have a same things on production environment. Can anybody tell me the correct way of migration or copying all the things between two liferay enviroments.
Mati Khan, geändert vor 13 Jahren.
RE: Migration of Permission
Junior Member Beiträge: 25 Beitrittsdatum: 01.11.10 Neueste Beiträge
I have fixed it by using ResourceLocalServiceUtil class. Example is as follows:
You can write these line in hook and able to fix permissions on startup.
ResourcePermissionLocalServiceUtil.setResourcePermissions(COMPANY.getCompanyId(), "com.liferay.portal.model.Organization",
ResourceConstants.SCOPE_COMPANY, String.valueOf(COMPANY.getCompanyId()), role.getRoleId(), new String[] { ActionKeys.VIEW });
You can write these line in hook and able to fix permissions on startup.
ResourcePermissionLocalServiceUtil.setResourcePermissions(COMPANY.getCompanyId(), "com.liferay.portal.model.Organization",
ResourceConstants.SCOPE_COMPANY, String.valueOf(COMPANY.getCompanyId()), role.getRoleId(), new String[] { ActionKeys.VIEW });