if(permission.getResourceId()!=null) {
Resource resource = resourceDao.get(permission.getResourceId());
permission.setResource(resource);
}
if(permission.getCategoryId()!=null) {
ProjectCategory category = projectCategoryDao.get(permission.getCategoryId());
permission.setCategory(category);
}
if(permission.getId()==null) {
permissionDao.save(permission);
} else {