Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.2] Delete user access level - check for levels in use #43223

Merged
merged 17 commits into from
Aug 8, 2024

Conversation

chmst
Copy link
Contributor

@chmst chmst commented Apr 6, 2024

Pull Request replacing #39654

Summary of Changes

An access level can only be deleted if there is no content which uses this level. But there is no information given, which tabels are concerned.
This PR adds the list of tables to the error message. It adds the delete method to the model and makes a check for all leves on all tables.

Testing Instructions

Add one or more access levels.
Set this access level for some items in your content, an article, a contact, a module .. whatever.
Then try to delete this access level.

Actual result BEFORE applying this Pull Request

You get a message
"You can't delete the view access level '%d:%s' because it is being used by content."

Expected result AFTER applying this Pull Request

grafik
Information is diplayed for all levels, where they are used.
This enables the experienced user to find the components and filter there for these levels.

Only leves are deleted (in my test above it was one (1) which are not in use.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@joomla-cms-bot joomla-cms-bot added Language Change This is for Translators PR-5.1-dev labels Apr 6, 2024
@chmst chmst mentioned this pull request Apr 6, 2024
4 tasks
@chmst chmst changed the title Delete user access level - check for levels in use [5.1] Delete user access level - check for levels in use Apr 6, 2024
@chmst chmst requested review from Quy and joomdonation April 6, 2024 17:38
@exlemor
Copy link

exlemor commented Apr 6, 2024

I have tested this item ✅ successfully on e449b22

I was able to test this successfully.

Just one tiny correction, the message after Patch is correct unlike the photo:

(photo) View Access Levels removed ---> (site) No View Access Levels removed.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43223.

@chmst
Copy link
Contributor Author

chmst commented Apr 6, 2024

In this case I wanted to delete 3 levels. One of them was deleted. Two of them could not be deleted, they are still in use. This is a bit confusing on the screen

@exlemor
Copy link

exlemor commented Apr 6, 2024

Ah ok. In my case, I tried to delete just 1 level.

@cybersalt
Copy link

cybersalt commented Apr 11, 2024

I have tested this item ✅ successfully on 615eb4e


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43223. I created 3 access levels, assigned 3 different articles (one to each) and then tried deleting the 3 levels. The message was the same for all three levels.

@exlemor
Copy link

exlemor commented Apr 11, 2024

I have tested this item ✅ successfully on 615eb4e

I have successfully tested it with 2 levels and multiple assets connected to said user levels.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43223.

@johnaspr
Copy link

johnaspr commented Apr 11, 2024

I have tested this item ✅ successfully on 615eb4e

I was able to test this. Message after applying the patch: "You can't delete the view access level(s)
Level with ID 8 is being used in the database tables: ifsam_content, ifsam_finder_links."


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43223.

@alikon
Copy link
Contributor

alikon commented Apr 11, 2024

rtc


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43223.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Apr 11, 2024
@HLeithner HLeithner changed the base branch from 5.1-dev to 5.2-dev April 24, 2024 09:06
@HLeithner
Copy link
Member

This pull request has been automatically rebased to 5.2-dev.

@pe7er pe7er removed their assignment May 7, 2024
@chmst chmst added the RMDQ ReleaseManagerDecisionQueue label May 14, 2024
@chmst chmst marked this pull request as draft May 23, 2024 15:12
@Quy Quy removed the RTC This Pull Request is Ready To Commit label May 23, 2024
@chmst
Copy link
Contributor Author

chmst commented May 24, 2024

Changed the code for displaying the message as requested.

grafik

@chmst chmst marked this pull request as ready for review May 24, 2024 09:00
@richard67 richard67 removed Updates Requested Indicates that this pull request needs an update from the author and should not be tested. RMDQ ReleaseManagerDecisionQueue labels May 29, 2024
@pe7er
Copy link
Contributor

pe7er commented May 29, 2024

Thanks for this PR @chmst
This PR has been changed, @cybersalt @exlemor @johnaspr Could you please test again?

@dorisdreher
Copy link

I have tested this item ✅ successfully on f8ee84c


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43223.

3 similar comments
@KingLouis1
Copy link

I have tested this item ✅ successfully on f8ee84c


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43223.

@crimle
Copy link

crimle commented Jul 15, 2024

I have tested this item ✅ successfully on f8ee84c


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43223.

@MacJoom
Copy link
Contributor

MacJoom commented Jul 15, 2024

I have tested this item ✅ successfully on f8ee84c


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43223.

@Hackwar Hackwar added the RTC This Pull Request is Ready To Commit label Aug 3, 2024
@pe7er pe7er self-assigned this Aug 8, 2024
@pe7er pe7er enabled auto-merge (squash) August 8, 2024 19:50
@pe7er pe7er merged commit c4807c7 into joomla:5.2-dev Aug 8, 2024
3 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Aug 8, 2024
@pe7er
Copy link
Contributor

pe7er commented Aug 8, 2024

Thanks @chmst !

@Quy Quy added this to the Joomla! 5.2.0 milestone Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.