Database space leak in ResourcePermission table after role deletion

Description

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

Environment

Tomcat 6.0 + MySQL 5. 6.0.x Revision 84387. Tomcat 6.0 + MySQL 5. 6.1.x Revision 84387.

Activity

Show:

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.

Fixed

Details

Assignee

Reporter

Branch Version/s

6.1.x
6.0.x

Backported to Branch

Committed

Git Pull Request

Components

Priority

Zendesk Support

Created April 28, 2011 at 8:35 AM
Updated June 24, 2023 at 9:41 AM
Resolved June 5, 2012 at 10:00 AM
Loading...