@@ -27,7 +27,6 @@ import skills.controller.result.model.BadgeResult
27
27
import skills.controller.result.model.UserRoleRes
28
28
import skills.services.admin.BadgeAdminService
29
29
import skills.services.admin.UserCommunityService
30
- import skills.services.quiz.QuizRoleService
31
30
import skills.services.userActions.DashboardAction
32
31
import skills.services.userActions.DashboardItem
33
32
import skills.services.userActions.UserActionInfo
@@ -48,9 +47,6 @@ class GlobalBadgeRoleService {
48
47
@Autowired
49
48
UserInfoService userInfoService
50
49
51
- @Autowired
52
- QuizRoleService quizRoleService
53
-
54
50
@Autowired
55
51
BadgeAdminService badgeAdminService
56
52
@@ -84,8 +80,8 @@ class GlobalBadgeRoleService {
84
80
if (currentUser?. toLowerCase() == userId?. toLowerCase()) {
85
81
throw new SkillException (" Cannot add roles to myself. userId=[${ userId} ]" , ErrorCode.AccessDenied )
86
82
}
87
- Boolean addingAsLocalAdmin = adminGroupId == null && roleName == RoleName . ROLE_QUIZ_ADMIN ;
88
- if (addingAsLocalAdmin && userRoleRepo. isUserQuizGroupAdmin (userId, badgeId)) {
83
+ Boolean addingAsLocalAdmin = adminGroupId == null && roleName == RoleName . ROLE_GLOBAL_BADGE_ADMIN ;
84
+ if (addingAsLocalAdmin && userRoleRepo. isUserGlobalBadgeAdmin (userId, badgeId)) {
89
85
throw new SkillException (" User is already part of an Admin Group and cannot be added as a local admin. userId=[${ userId} ]" , ErrorCode.AccessDenied )
90
86
}
91
87
accessSettingsStorageService. addGlobalAdminUserRoleForUser(userId, badgeResult. badgeId, RoleName . ROLE_GLOBAL_BADGE_ADMIN )
@@ -94,10 +90,10 @@ class GlobalBadgeRoleService {
94
90
String userIdForDisplay = userAttrs?. userIdForDisplay ?: userId
95
91
userActionsHistoryService. saveUserAction(new UserActionInfo (
96
92
action : DashboardAction.Create , item : DashboardItem.UserRole ,
97
- itemId : userIdForDisplay, badgeId : badgeResult . badgeId,
93
+ itemId : userIdForDisplay,
98
94
actionAttributes : [
99
95
userRole : roleName,
100
- quizName : badgeResult. name,
96
+ badgeName : badgeResult. name,
101
97
badgeId : badgeResult. badgeId,
102
98
]
103
99
))
0 commit comments