moltam89/liferay-portal — pull request #232 by lipusz (2013-08-02 07:54:08+00:00)
Title: [TECHNICAL-SUPPORT | July 30] LPS-38432  ADD_ARTICLE permission is not enough to add new Web Content from Structure with Default Values

Hi Tamás,

http://issues.liferay.com/browse/LPS-38432

Read my comments: http://issues.liferay.com/browse/LPS-38432?focusedCommentId=337596&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-337596

I also created a list of cases of edit_article.jsp in terms of variable-context:

=== Cases for edit_article.jsp

1. Edit Structure Default Values - 1st time
- article == null >>> article.isNew() never reached
- articleId == ""
- classPK > 0
- classNameId > 0
- structureId > 0
>>> Should require ADD_ARTICLE permission

2. Edit Structure Default Values - 2nd time
- article != null >>> article.isNew() == false
- articleId > 0
- classPK > 0
- classNameId > 0
- structureId > 0
>>> Should require UPDATE permission

3. Add new Web Content using a Structure WITH Default Values
- article != null && article.isNew() == true
- articleId == null
- classPK == 0
- classNameId == 0
- structureId > 0
>>> Should require ADD_ARTICLE permission

4. Add new Web Content using a Structure WITHOUT Default Values
- article == null
- articleId == null
- classPK == 0
- classNameId == 0
- structureId > 0
>>> Should require ADD_ARTICLE permission

5. Add new Web Content from Basic Web Content
- article == null
- articleId == null
- classPK == 0
- classNameId == 0
- structureId == 0
>>> Should require ADD_ARTICLE permission

6. Edit existing Web Content
>>> Should require UPDATE permission

Please, review my pull & let me know if my solution would not cover all scenarios.
If you find it correct, please, include the list above in the forwarded pull too. It makes easier to understand the context

Regards,
Tibor