0

我正在尝试在 Liferay 7.1 上实现权限(资源和模型)。我注意到BaseModelPermissionChecker现在已弃用(所以我不应该让我的权限类扩展它)。所以我尝试按照Liferay官方教程
中的指示做 但是,在部署我的osgi服务时,OSGI容器提示以下错误(对于模型和资源权限):

ERROR [Refresh Thread: Equinox Container: 80bbc977-c7cb-0018-1000-82f21869d6ec][com_liferay_training_space_gradebook_service:97] [com.a.b.c.service.permission.MyEntityPermission(3887)] Field _portletResourcePermission in component class com.a.b.c.service.permission.MyEntityPermission must not be static.

你有那个错误吗?我跳过了什么吗?

编辑

创建的组件:

@Component(immediate = true, service = {})
public class BookResourcePermission {

public static final String ADD_BOOK = "ADD_BOOK";

@Reference(target = "(resource.name=com.x.y.mybook.model)", unbind = "-")
protected static void setPortletResourcePermission(PortletResourcePermission portletResourcePermission) {
    _portletResourcePermission = portletResourcePermission;
}

public static boolean contains(PermissionChecker permissionChecker, long groupId, String actionId) {
    return _portletResourcePermission.contains(permissionChecker, groupId, actionId);
}

private static PortletResourcePermission _portletResourcePermission;
}

谢谢 !

4

0 回答 0