File tree 1 file changed +14
-1
lines changed
src/main/kotlin/com/mairwunnx/projectessentials/permissions/permissions
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -86,11 +86,21 @@ object PermissionsAPI {
86
86
groupName : String
87
87
): List <String > {
88
88
val permissions = mutableListOf<String >()
89
+
90
+ if (groupName.isEmpty()) {
91
+ val defaultGroup = getDefaultGroup()
92
+ permissions.addAll(defaultGroup.permissions)
93
+ defaultGroup.inheritFrom.forEach {
94
+ permissions.addAll(getGroupPermissions(it, true ))
95
+ }
96
+ return permissions
97
+ }
98
+
89
99
PermissionBase .permissionData.groups.forEach { group ->
90
100
if (group.name == groupName) {
91
101
permissions.addAll(group.permissions)
92
102
group.inheritFrom.forEach {
93
- permissions.addAll(getGroupPermissions(it))
103
+ permissions.addAll(getGroupPermissions(it, true ))
94
104
}
95
105
return permissions
96
106
}
@@ -152,6 +162,9 @@ object PermissionsAPI {
152
162
if (user.nickname == " *" ) defaultPerms = user.permissions
153
163
if (user.nickname == playerNickName) groupName = user.group
154
164
}
165
+
166
+ if (groupName.isEmpty()) groupName = getUserGroup(playerNickName).name
167
+
155
168
val groupPerms = getAllGroupPermissions(groupName)
156
169
val userPerms = getUserPermissions(playerNickName)
157
170
You can’t perform that action at this time.
0 commit comments