Permissionable permissionable = host == null?folder:host;
List<Permission> permissionsToSave = new ArrayList<Permission>();
if(APILocator.getPermissionAPI().isInheritingPermissions(permissionable)){
Permissionable parentPermissionable = permissionAPI.findParentPermissionable(permissionable);
permissionAPI.permissionIndividually(parentPermissionable, permissionable, systemUser, respectFrontendRoles);
}
if(permissions.get("individual") != null) {
int permission = Integer.parseInt(permissions.get("individual"));
permissionsToSave.add(new Permission(PermissionAPI.INDIVIDUAL_PERMISSION_TYPE, permissionable.getPermissionId(), roleId, permission, true));