File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
src/main/kotlin/com/mairwunnx/projectessentials/permissions/permissions Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -86,11 +86,21 @@ object PermissionsAPI {
8686 groupName : String
8787 ): List <String > {
8888 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+
8999 PermissionBase .permissionData.groups.forEach { group ->
90100 if (group.name == groupName) {
91101 permissions.addAll(group.permissions)
92102 group.inheritFrom.forEach {
93- permissions.addAll(getGroupPermissions(it))
103+ permissions.addAll(getGroupPermissions(it, true ))
94104 }
95105 return permissions
96106 }
@@ -152,6 +162,9 @@ object PermissionsAPI {
152162 if (user.nickname == " *" ) defaultPerms = user.permissions
153163 if (user.nickname == playerNickName) groupName = user.group
154164 }
165+
166+ if (groupName.isEmpty()) groupName = getUserGroup(playerNickName).name
167+
155168 val groupPerms = getAllGroupPermissions(groupName)
156169 val userPerms = getUserPermissions(playerNickName)
157170
You can’t perform that action at this time.
0 commit comments