-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from ddivad195/feat/permissions-update
feat: update permissions using latest dkt snapshot
- Loading branch information
Showing
8 changed files
with
28 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 6 additions & 15 deletions
21
src/main/kotlin/me/ddivad/keeper/dataclasses/Permissions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,11 @@ | ||
package me.ddivad.keeper.dataclasses | ||
|
||
import me.jakejmattson.discordkt.dsl.Permission | ||
import me.jakejmattson.discordkt.dsl.PermissionSet | ||
import me.jakejmattson.discordkt.dsl.permission | ||
import dev.kord.common.entity.Permission | ||
import dev.kord.common.entity.Permissions | ||
|
||
@Suppress("unused") | ||
object Permissions : PermissionSet { | ||
val BOT_OWNER = permission("Bot Owner") { users(discord.getInjectionObjects<Configuration>().botOwner) } | ||
val GUILD_OWNER = permission("Guild Owner") { guild?.ownerId?.let { users(it) } } | ||
val STAFF = permission("Staff") { | ||
discord.getInjectionObjects<Configuration>()[guild!!.id]?.requiredRoleId?.let { | ||
roles(it) | ||
} | ||
} | ||
val NONE = permission("None") { guild?.everyoneRole?.let { roles(it.id) } } | ||
|
||
override val hierarchy: List<Permission> = listOf(NONE, STAFF, GUILD_OWNER, BOT_OWNER) | ||
override val commandDefault: Permission = STAFF | ||
object Permissions { | ||
val GUILD_OWNER = Permissions(Permission.ManageGuild) | ||
val STAFF = Permissions(Permission.ManageMessages) | ||
val EVERYONE = Permissions(Permission.SendMessages) | ||
} |