• Icon: Suggestion Suggestion
    • Resolution: Fixed
    • 5.0.0, 4.14.4
    • None
    • None
    • We collect Bitbucket feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      The userAdminService.revokeAllGlobalPermissions can get ClassCastException if you pass DetailedUser object instead of ApplicationUser from userService.

          Form Name

            [BSERV-9648] InternalConverter does not know about DetailedUser

            Katherine Yabut made changes -
            Workflow Original: JAC Suggestion Workflow [ 3395458 ] New: JAC Suggestion Workflow 3 [ 3620936 ]
            Status Original: RESOLVED [ 5 ] New: Closed [ 6 ]
            Monique Khairuliana (Inactive) made changes -
            Workflow Original: BSERV Suggestions Workflow [ 2684737 ] New: JAC Suggestion Workflow [ 3395458 ]
            Owen made changes -
            Workflow Original: Stash Workflow [ 1770122 ] New: BSERV Suggestions Workflow [ 2684737 ]
            Status Original: Closed [ 6 ] New: Resolved [ 5 ]

            Thanks a lot, Bryan!

            Alexey Efimov added a comment - Thanks a lot, Bryan!
            Bryan Turner (Inactive) made changes -
            Assignee New: Bryan Turner [ bturner ]
            Bryan Turner (Inactive) made changes -
            Fix Version/s New: 4.14.4 [ 67332 ]
            Fix Version/s New: 5.0.0 [ 66696 ]
            Resolution New: Fixed [ 1 ]
            Status Original: Needs Triage [ 10030 ] New: Closed [ 6 ]

            Bryan Turner (Inactive) added a comment - - edited

            Alexey,

            I've made a small change to InternalConverter that may help with this. Since this isn't a pressing issue, it by itself won't prompt us to cut 4.14.4. But I've included it on the branch, so when the next bugfix release for 4.14 is built this change will be in it. You've indicated before that you already monitor for releases, so I'm sure you'll see it when it happens!

            Best regards,
            Bryan Turner
            Atlassian Bitbucket

            Bryan Turner (Inactive) added a comment - - edited Alexey, I've made a small change to InternalConverter that may help with this. Since this isn't a pressing issue, it by itself won't prompt us to cut 4.14.4. But I've included it on the branch, so when the next bugfix release for 4.14 is built this change will be in it. You've indicated before that you already monitor for releases, so I'm sure you'll see it when it happens! Best regards, Bryan Turner Atlassian Bitbucket
            Bryan Turner (Inactive) made changes -
            Remote Link New: This issue links to "Bitbucket Server › Pull Request Build › BSERV-9648-bturner-convert-detailed-users (server-syd-bamboo)" [ 272537 ]
            Bryan Turner (Inactive) made changes -
            Remote Link New: This issue links to "Bitbucket Server › Pull Request Build with Coverage › BSERV-9648-bturner-convert-detailed-users (server-syd-bamboo)" [ 272536 ]

            Hello Bryan,

            We have job, that monitored users who no longer used Bitbucket for a long time. This required us to get DetailedUser (it has last auth timestamp). For such users we need to revoke License. But instead of error now we have follow code:

             

            // Avoid ClassCastException
            // See https://jira.atlassian.com/browse/BSERV-9648
            ApplicationUser applicationUser = userService.getUserById(user.getId());
            if (applicationUser == null) {
             throw new IllegalStateException("User not found " + user.getName());
            }
            permissionAdminService.revokeAllGlobalPermissions(applicationUser); 
            

             

            Alexey Efimov added a comment - Hello Bryan, We have job, that monitored users who no longer used Bitbucket for a long time. This required us to get DetailedUser (it has last auth timestamp). For such users we need to revoke License. But instead of error now we have follow code:   // Avoid ClassCastException // See https://jira.atlassian.com/browse/BSERV-9648 ApplicationUser applicationUser = userService.getUserById(user.getId()); if (applicationUser == null ) { throw new IllegalStateException( "User not found " + user.getName()); } permissionAdminService.revokeAllGlobalPermissions(applicationUser);   

              bturner Bryan Turner (Inactive)
              3652ed9ede2e Alexey Efimov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: