Database space leak in ResourcePermission table after role deletion
Description
Environment
relates
Activity

Sophia.ZhangJuly 6, 2012 at 2:37 AM
PASSED Manual Testing using the following steps:
1. Create ordinary role e.g. testrole1
2. Upload e.g. file1 into document library
3. Permit some actions on file1 for testrole1
4. Go to database, find table Role_, record the roledid.
5. Delete testrole1.
6. Go to database and find table ResourcePermission. Try to search the recorded roleid
Reproduced on:
Tomcat 7.0 + MySQL 5. Portal 6.1.x EE GIT ID: 78800f25ccbbb64ae065bd23a5d1cf897bb5e663.
User can find the roleId in ResourcePermission table. This is supposed to be deleted after the actual role deletion.
Fixed on:
Tomcat 6.0 + MySQL 5. Portal 6.0.x EE GIT ID: 67ad8c854c9062c51a15ee938e0609a20f21a1d1.
Tomcat 7.0 + MySQL 5. Portal 6.1.x EE GIT ID: 83d7c84294cbaff265e62eb33e04cabaf8ad1294.
Tomcat 7.0 + MySQL 5. Portal 6.2.x GIT ID: 702c4ffa129d6be718ef8c319949ef47125aa272.
The roleId is deleted completely after the actual role deletion.

Lawrence LeeJuly 5, 2012 at 3:28 PM
Committed on:
Portal 6.0.x GIT ID: 39bce01b69e2a83ab1ceecd1ba7eed9b1ec2302a.
Portal 6.1.x EE GIT ID: 65cbd2904f12395071e330f29100cb0cb6d50293.
Portal 6.2.x GIT ID: ce0b3822b32a6bcf5cfb93fe16eae049ef585ffd.

Pani GuiJune 28, 2011 at 11:32 PM
Hi Wojciech Zalecki,
Thank you for your report. I was able to reproduce this issue in Liferay Portal 6.0.6 and 6.0.11 and our current trunk head. I will update this ticket to reflect this issue.
Details
Assignee
Sophia.ZhangSophia.Zhang(Deactivated)Reporter
Wojciech ZaleckiWojciech ZaleckiLabels
Branch Version/s
6.1.x6.0.xBackported to Branch
CommittedGit Pull Request
Components
Fix versions
Affects versions
Priority
Medium
Details
Details
Assignee

Reporter

Labels
Branch Version/s
Backported to Branch
Git Pull Request
Components
Fix versions
Affects versions
Priority
Zendesk Support
Linked Tickets
Zendesk Support
Linked Tickets
Zendesk Support

It is possible to have 'unused' records in ResourcePermission table after deleting a role.
Steps to reproduce:
1. create ordinary role e.g. testrole1
2. upload e.g. file1 into document library
3. permit some actions on file1 for testrole1
4. delete testrole1
After deletion in ResourcePermission table there is a record with roleId of deleted testrole1 . This record will remain until file1 is deleted.
This can cause also NoSuchRoleException when retrieved role if used roleId from ResourcePermission