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));
}




Share on Google Plus

About Meera Prince

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment