Foren

Adding New Resource Permission

thumbnail
yan paing, geändert vor 13 Jahren.

Adding New Resource Permission

Regular Member Beiträge: 128 Beitrittsdatum: 11.03.10 Neueste Beiträge
Hi everyone,
I would like to know how to solve the resource permission issue for adding new permission.
As soon as i start the server there is an exception about resource permission is.




2011-01-19 10:36:50,305 INFO db.BaseDB [main] (BaseDB.java:392) - Database supports case sensitive queries
2011-01-19 10:36:50,852 ERROR permission.ResourceActionsUtil [main] (ResourceActionsUtil.java:477) - java.lang.NullPointerException
java.lang.NullPointerException
at com.liferay.portal.security.permission.ResourceActionsUtil._readActionKeys(ResourceActionsUtil.java:884)
at com.liferay.portal.security.permission.ResourceActionsUtil._readGuestUnsupportedActions(ResourceActionsUtil.java:930)
at com.liferay.portal.security.permission.ResourceActionsUtil._readPortletResource(ResourceActionsUtil.java:1061)
at com.liferay.portal.security.permission.ResourceActionsUtil._read(ResourceActionsUtil.java:871)
at com.liferay.portal.security.permission.ResourceActionsUtil._read(ResourceActionsUtil.java:860)
at com.liferay.portal.security.permission.ResourceActionsUtil.<init>(ResourceActionsUtil.java:473)



After the server started and when i do the action for permission there is another exception also and the exception is

2011-01-19 10:45:57,875 INFO impl.KnowledgeCenterLocalServiceImpl [TP-Processor5] (KnowledgeCenterLocalServiceImpl.java:160) - Exception There are no actions associated with the resource com.platform.srv.kc.model.KnowledgeCenter



The attached files :
Language_ext.properties and Language_en.properties files are under ext-impl/src/content
default-aux.xml and knowledgecenter.xml files are under ext-impl/src/resource-actions



Language_ext.properties
## Model resources
model.resource.com.platform.srv.kc.model.KnowledgeCenter=KnowledgeCenter
## Action names
##action.ADD_BOOK=Add Book

action.VIEW=View
action.DELETE=Delete
action.DELETE_DISCUSSION=Delete Discussion
action.PERMISSIONS=Permissions
action.ADD_DISCUSSION=Add Discussion
action.UPDATE=Update
action.UPDATE_DISCUSSION=Update Discussion


portal-ext.properties
## resource action configurations
resource.actions.configs=resource-actions/default.xml,resource-actions/default-aux.xml


default-aux.xml
<?xml version="1.0"?>
<resource-action-mapping>
<resource file="resource-actions/knowledgecenter.xml" />
</resource-action-mapping>


knowledgecenter.xml
<?xml version="1.0"?>
<resource-action-mapping>
<portlet-resource>
<portlet-name>KnowledgeCenter_WAR_KnowledgeCenterportlet</portlet-name>
<permissions>
<supports>
<action-key>ACCESS_IN_CONTROL_PANEL</action-key>
<action-key>ADD_TO_PAGE</action-key>
<action-key>CONFIGURATION</action-key>
<action-key>VIEW</action-key>
</supports>
<community-defaults>
<action-key>VIEW</action-key>
</community-defaults>
<guest-defaults>
<action-key>VIEW</action-key>
</guest-defaults>
</permissions>
</portlet-resource>
<model-resource>
<model-name>sambaash.platform.srv.kc.model.KnowledgeCenter</model-name>
<portlet-ref>
<portlet-name>KnowledgeCenter_WAR_KnowledgeCenterportlet</portlet-name>
</portlet-ref>
<permissions>
<supports>
<action-key>ADD_DISCUSSION</action-key>
<action-key>DELETE</action-key>
<action-key>DELETE_DISCUSSION</action-key>
<action-key>PERMISSIONS</action-key>
<action-key>UPDATE</action-key>
<action-key>UPDATE_DISCUSSION</action-key>
<action-key>VIEW</action-key>
</supports>
<community-defaults>
<action-key>ADD_DISCUSSION</action-key>
<action-key>VIEW</action-key>
</community-defaults>
<guest-defaults>
<action-key>VIEW</action-key>
</guest-defaults>
<guest-unsupported>
<action-key>ADD_DISCUSSION</action-key>
<action-key>DELETE</action-key>
<action-key>DELETE_DISCUSSION</action-key>
<action-key>PERMISSIONS</action-key>
<action-key>UPDATE</action-key>
<action-key>UPDATE_DISCUSSION</action-key>
</guest-unsupported>
</permissions>
</model-resource>
</resource-action-mapping>


Thanks and Regards,
Yan
thumbnail
yan paing, geändert vor 13 Jahren.

RE: Adding New Resource Permission

Regular Member Beiträge: 128 Beitrittsdatum: 11.03.10 Neueste Beiträge
Hello everyone,
Is there anyone who familiar with these kind of issue?
Thanks,
Yan
Sean Coffey, geändert vor 13 Jahren.

RE: Adding New Resource Permission

New Member Beiträge: 12 Beitrittsdatum: 28.03.11 Neueste Beiträge
The documentation on permission is obviously missing something. Can anyone help with this? Is there a bug?
thumbnail
K P, geändert vor 12 Jahren.

RE: Adding New Resource Permission

New Member Beitrag: 1 Beitrittsdatum: 28.07.11 Neueste Beiträge
I will answer. The reason is an error in docs - a missing tag in my-permision-mapping.xml file. Thats why you get null pointer exception. Along with <community-defaults> and <guest-defaults> there should be <guest-unsupported> tag. Also those three should be located in <supports>, which should be located <permissions> tag.

When will Liferay finally fix docs and examples? Providing not working examples wastes everybody time and dimisish future stability and prospect of the framework. Customers want not only a good product, but also excelent service, particularly in GFC times.

KP