<?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>Unsatisfied Permission References in -ServiceImpl classes</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=111293669" />
  <subtitle>Unsatisfied Permission References in -ServiceImpl classes</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=111293669</id>
  <updated>2026-04-07T09:05:03Z</updated>
  <dc:date>2026-04-07T09:05:03Z</dc:date>
  <entry>
    <title>RE: Unsatisfied Permission References in -ServiceImpl classes</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111347882" />
    <author>
      <name>Minhchau Dang</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111347882</id>
    <updated>2018-10-26T20:58:45Z</updated>
    <published>2018-10-26T20:58:45Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;blockquote&gt;David IlechukwuI have the following permissions variable declarations&amp;nbsp; in my -ServiceImpl classes&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;private static volatile ModelResourcePermission&amp;lt;credentialtype&amp;gt;
&amp;amp;nbsp; &amp;amp;nbsp; _credentialTypeModelResourcePermission =
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; ModelResourcePermissionFactory.getInstance(
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; CredentialTypeServiceImpl.class,
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; "_credentialTypeModelResourcePermission", CredentialType.class);
&amp;lt;/credentialtype&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br&gt;Technically, the only thing that code does is allow you to inject the OSGi component, which you declare as providing the &lt;span style="font-family: monospace"&gt;ModelResourcePermission&lt;/span&gt; service with the corresponding &lt;span style="font-family: monospace"&gt;model.class.name&lt;/span&gt; property, into a Spring bean's static field.&lt;br&gt;&lt;br&gt;In other words, you still need to have a ModelResourcePermission component. You can either declare the component normally, like in &lt;a href="https://github.com/liferay/liferay-portal/blob/7.1.0-ga1/modules/apps/dynamic-data-mapping/dynamic-data-mapping-service/src/main/java/com/liferay/dynamic/data/mapping/internal/security/permission/resource/DDMTemplateModelResourcePermission.java#L36-L40"&gt;DDMTemplate&lt;/a&gt;, or you can ask Liferay to generate one using Java 8's function objects and register it directly against the bundle context, like in &lt;a href="https://github.com/liferay/liferay-portal/blob/7.1.0-ga1/modules/apps/dynamic-data-mapping/dynamic-data-mapping-service/src/main/java/com/liferay/dynamic/data/mapping/internal/security/permission/resource/DDMFormInstanceModelResourcePermissionRegistrar.java#L43-L61"&gt;DDMFormInstance&lt;/a&gt;.&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Minhchau Dang</dc:creator>
    <dc:date>2018-10-26T20:58:45Z</dc:date>
  </entry>
  <entry>
    <title>Unsatisfied Permission References in -ServiceImpl classes</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111293668" />
    <author>
      <name>David Ilechukwu</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111293668</id>
    <updated>2018-10-23T14:32:05Z</updated>
    <published>2018-10-23T14:32:05Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;I have the following permissions variable declarations&amp;nbsp; in my -ServiceImpl classes&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;&amp;amp;nbsp; &amp;amp;nbsp; private static volatile ModelResourcePermission&amp;lt;credentialtype&amp;gt;
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; _credentialTypeModelResourcePermission =
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; ModelResourcePermissionFactory.getInstance(
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; CredentialTypeServiceImpl.class,
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; "_credentialTypeModelResourcePermission", CredentialType.class);
&amp;amp;nbsp; &amp;amp;nbsp;&amp;amp;nbsp;
&amp;amp;nbsp; &amp;amp;nbsp; private static volatile PortletResourcePermission
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; _portletResourcePermission =
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; PortletResourcePermissionFactory.getInstance(
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; CredentialTypeServiceImpl.class, "_portletResourcePermission",
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; HrmCoreConstants.RESOURCE_NAME);&amp;amp;nbsp;
&amp;lt;/credentialtype&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;But why I try to use these variables in a permissions check method, like this&lt;br&gt;&lt;pre&gt;&lt;code&gt;&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; _portletResourcePermission.check(getPermissionChecker(),&amp;amp;nbsp;
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; serviceContext.getScopeGroupId(), ActionKeys.ADD_CREDENTIAL_TYPE);&amp;amp;nbsp;
&lt;/code&gt;&lt;/pre&gt;&lt;br&gt; I get the "Unsatisfied References error" stating that the variables could be resolved because the target class&amp;nbsp;&lt;pre&gt;&lt;code&gt;​​​​​​​model.class.name=com.tpl.pmedics.hrm_core.model.CredentialType&lt;/code&gt;&lt;/pre&gt;&amp;nbsp;was unavilable. I get the same errors for my _portletResourcePermission variable, when I try to use it in a permisions check.&lt;br&gt;&lt;br&gt;And then this error seems to propagate into&amp;nbsp; my portlet web module as well, since my OSGI references (in my helper permission classes) fail as well-&lt;br&gt;&lt;pre&gt;&lt;code&gt;&amp;amp;nbsp; &amp;amp;nbsp; @Reference(
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; target = "(model.class.name=com.tpl.pmedics.hrm_core.model.CredentialType)",
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; unbind = "-"
&amp;amp;nbsp; &amp;amp;nbsp; )
&amp;amp;nbsp; &amp;amp;nbsp; protected void setModelResourcePermission(
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; ModelResourcePermission&amp;lt;credentialtype&amp;gt; modelResourcePermission) {

&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; _credentialTypeModelResourcePermission = modelResourcePermission;
&amp;amp;nbsp; &amp;amp;nbsp; }

&amp;amp;nbsp; &amp;amp;nbsp; private static ModelResourcePermission&amp;lt;credentialtype&amp;gt;
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; _credentialTypeModelResourcePermission; &amp;amp;nbsp;
&amp;lt;/credentialtype&amp;gt;&amp;lt;/credentialtype&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;giving the same "Unsatisfied References" error. I am using Liferay 7.1 service builder. My -api and -service modules both deploy successfully to the server (using the blade deploy command) without any errors in the log.&lt;br&gt;&lt;br&gt;Any help please why this is happening, please?&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>David Ilechukwu</dc:creator>
    <dc:date>2018-10-23T14:32:05Z</dc:date>
  </entry>
</feed>
