<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Liferay Guestbook Web Application 7.2, ModelResourcePermissionFactory error</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=114503082" />
  <subtitle>Liferay Guestbook Web Application 7.2, ModelResourcePermissionFactory error</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=114503082</id>
  <updated>2026-04-04T15:39:45Z</updated>
  <dc:date>2026-04-04T15:39:45Z</dc:date>
  <entry>
    <title>RE: Liferay Guestbook Web Application 7.2, ModelResourcePermissionFactory e</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114511250" />
    <author>
      <name>Ivano Carrara</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114511250</id>
    <updated>2019-07-30T17:46:42Z</updated>
    <published>2019-07-30T17:46:42Z</published>
    <summary type="html">SOLVED&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In &lt;strong&gt;build.grade&lt;/strong&gt; I added:&lt;br /&gt;&lt;br /&gt;compileOnly group: &amp;#34;com.liferay&amp;#34;, name: &amp;#34;com.liferay.petra.function&amp;#34;</summary>
    <dc:creator>Ivano Carrara</dc:creator>
    <dc:date>2019-07-30T17:46:42Z</dc:date>
  </entry>
  <entry>
    <title>Liferay Guestbook Web Application 7.2, ModelResourcePermissionFactory error</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114503081" />
    <author>
      <name>Ivano Carrara</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114503081</id>
    <updated>2019-07-30T12:24:13Z</updated>
    <published>2019-07-30T12:24:13Z</published>
    <summary type="html">Dear all, following the Guestbook tutorial from 7.1 documentation but in the 7.2 environment I found an issue in the &amp;#34;Using Resources and Permissions&amp;#34; chapter.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In the &amp;lt;somepackage&amp;gt;&lt;strong&gt;guestbook.internal.security.permission.resource&lt;/strong&gt; I created the &lt;strong&gt;GuestbookModelResourcePermissionRegistrar &lt;/strong&gt;class.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;But in the &lt;strong&gt;activate()&lt;/strong&gt; method I get an error that cause that I can&amp;#39;t deploy the &lt;strong&gt;guestbook-service&lt;/strong&gt; and &lt;strong&gt;guestbook-web modules&lt;/strong&gt;:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;@Activate&lt;br /&gt;    public void activate(BundleContext bundleContext) {&lt;br /&gt;        &lt;br /&gt;        Dictionary&amp;lt;String, Object&amp;gt; properties = new HashMapDictionary&amp;lt;&amp;gt;();&lt;br /&gt;&lt;br /&gt;        properties.put(&amp;#34;model.class.name&amp;#34;, Guestbook.class.getName());&lt;br /&gt;&lt;br /&gt;        _serviceRegistration = bundleContext.registerService(&lt;br /&gt;            ModelResourcePermission.class,&lt;br /&gt;            ModelResourcePermissionFactory.create(   &lt;strong&gt;// ERROR: &lt;span style="color: #ff0000"&gt;The type com.liferay.petra.function.UnsafeFunction cannot be resolved. It is indirectly referenced from required .class files&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;                Guestbook.class, Guestbook::getGuestbookId,&lt;br /&gt;                _guestbookLocalService::getGuestbook, _portletResourcePermission,&lt;br /&gt;                (modelResourcePermission, consumer) -&amp;gt; {&lt;br /&gt;                    consumer.accept(&lt;br /&gt;                        new StagedModelPermissionLogic&amp;lt;&amp;gt;(&lt;br /&gt;                            _stagingPermission, GuestbookPortletKeys.GUESTBOOK,&lt;br /&gt;                            Guestbook::getGuestbookId));&lt;br /&gt;                    consumer.accept(&lt;br /&gt;                        new WorkflowedModelPermissionLogic&amp;lt;&amp;gt;(&lt;br /&gt;                                _workflowPermission, modelResourcePermission,&lt;br /&gt;                                _groupLocalService, Guestbook::getGuestbookId));&lt;br /&gt;                }),&lt;br /&gt;            properties);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The same error happens for both Guestbook and Entity entities of the tutorial.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Please anyone is already aware of the above issues?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Thank you in advance,&lt;br /&gt;Ivano C.</summary>
    <dc:creator>Ivano Carrara</dc:creator>
    <dc:date>2019-07-30T12:24:13Z</dc:date>
  </entry>
</feed>
