Friday, January 25, 2013

How to clone/copy permission system of role to another role?


How to clone/copy permission system of  role to another role?


java.util.List<com.liferay.portal.model.ResourcePermission> resourcePermissionList= ResourcePermissionLocalServiceUtil. getRoleResourcePermissions(
                   long roleId);
Use above method and pass role and get all ResourcePermission objects.
for(int i=0;i< resourcePermissionList.size();i++){
ResourcePermissionLocalServiceUtil. addResourcePermission (
                   resourcePermissionList.get(i).setRoleId(newRoleId));
}




Popular Posts

Recent Posts

Recent Posts Widget