final Item item = rootDomainObject.readItemByOID(itemId); final Group permittedGroup = createPermittedGroup(newPermittedGroupType, item.getSection().getSite().getExecutionCourse());  final FileItem fileItem = FileItem.readByOID(fileItemId); fileItem.setFileItemPermittedGroupType(newPermittedGroupType); fileItem.setPermittedGroup(permittedGroup);
fileItem.setPermittedGroup(group);
    public void run(Integer itemId, Integer fileItemId, FileItemPermittedGroupType newPermittedGroupType)            throws FenixServiceException, ExcepcaoPersistencia, DomainException, FileManagerException {        final Item item = rootDomainObject.readItemByOID(itemId);        final Group permittedGroup = createPermittedGroup(newPermittedGroupType, item.getSection().getSite().getExecutionCourse());        final FileItem fileItem = FileItem.readByOID(fileItemId);        fileItem.setFileItemPermittedGroupType(newPermittedGroupType);        fileItem.setPermittedGroup(permittedGroup);        FileManagerFactory.getFileManager().changeFilePermissions(                fileItem.getExternalStorageIdentification(), (permittedGroup != null) ? true : false);    }