Skip to content

Commit f809ea0

Browse files
committed
Mistake in group setting for user fixed.
Signed-off-by: Pavel Erokhin (MairwunNx) <MairwunNx@gmail.com>
1 parent 3829e62 commit f809ea0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/kotlin/com/mairwunnx/projectessentials/permissions/api/v1/PermissionsAPI.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ object PermissionsAPI {
3232
* @return true if group with specified name exist.
3333
* @since 2.0.0-SNAPSHOT.1.
3434
*/
35-
fun groupExist(name: String) = permissions.take().groups.filter { it.name == name }.count() > 0
35+
fun groupExist(name: String) = getGroups().filter { it.name == name }.count() > 0
3636

3737
/**
3838
* @return default group data model instance.
@@ -405,7 +405,7 @@ object PermissionsAPI {
405405
* @since 2.0.0-SNAPSHOT.1.
406406
*/
407407
fun setUserGroup(name: String, groupName: String): Boolean {
408-
if (!groupExist(name)) return false
408+
if (!groupExist(groupName)) return false
409409
if (getUserGroup(name) == groupName) return false
410410

411411
if (!userExist(name)) addUser(User(name, groupName, mutableListOf()))

0 commit comments

Comments
 (0)