Package net.dv8tion.jda.core.entities
Interface PermissionOverride
-
public interface PermissionOverride
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AuditableRestAction<java.lang.Void>
delete()
Deletes this PermissionOverride.java.util.List<Permission>
getAllowed()
An unmodifiable list of allPermissions
that are specifically allowed by this override.long
getAllowedRaw()
This is the raw binary representation (as a base 10 long) of the permissions allowed by this override.Channel
getChannel()
TheChannel
that thisPermissionOverride
affects.java.util.List<Permission>
getDenied()
An unmodifiable list of allPermissions
that are denied by this override.long
getDeniedRaw()
This is the raw binary representation (as a base 10 long) of the permissions denied by this override.Guild
getGuild()
java.util.List<Permission>
getInherit()
An unmodifiable list of allPermission
that are unaffected by this override.long
getInheritRaw()
This is the raw binary representation (as a base 10 long) of the permissions not affected by this override.JDA
getJDA()
TheJDA
instance that thisPermissionOverride
is related to.PermOverrideManager
getManager()
Returns thePermOverrideManager
for this PermissionOverride.Member
getMember()
If thisPermissionOverride
is an override dealing with aMember
, then this method will return the relatedMember
.Role
getRole()
If thisPermissionOverride
is an override dealing with aRole
, then this method will return the relatedRole
.boolean
isMemberOverride()
Used to determine if thisPermissionOverride
relates to a specificMember
.boolean
isRoleOverride()
Used to determine if thisPermissionOverride
relates to a specificRole
.
-
-
-
Method Detail
-
getAllowedRaw
long getAllowedRaw()
This is the raw binary representation (as a base 10 long) of the permissions allowed by this override.
The long relates to the offsets used by eachPermission
.- Returns:
- Never-negative long containing the binary representation of the allowed permissions of this override.
-
getInheritRaw
long getInheritRaw()
This is the raw binary representation (as a base 10 long) of the permissions not affected by this override.
The long relates to the offsets used by eachPermission
.- Returns:
- Never-negative long containing the binary representation of the unaffected permissions of this override.
-
getDeniedRaw
long getDeniedRaw()
This is the raw binary representation (as a base 10 long) of the permissions denied by this override.
The long relates to the offsets used by eachPermission
.- Returns:
- Never-negative long containing the binary representation of the denied permissions of this override.
-
getAllowed
java.util.List<Permission> getAllowed()
An unmodifiable list of allPermissions
that are specifically allowed by this override.- Returns:
- Possibly-empty unmodifiable list of allowed
Permissions
.
-
getInherit
java.util.List<Permission> getInherit()
An unmodifiable list of allPermission
that are unaffected by this override.- Returns:
- Possibly-empty unmodifiable list of unaffected
Permissions
.
-
getDenied
java.util.List<Permission> getDenied()
An unmodifiable list of allPermissions
that are denied by this override.- Returns:
- Possibly-empty unmodifiable list of denied
Permissions
.
-
getJDA
JDA getJDA()
TheJDA
instance that thisPermissionOverride
is related to.- Returns:
- Never-null
JDA
instance.
-
getMember
Member getMember()
If thisPermissionOverride
is an override dealing with aMember
, then this method will return the relatedMember
.
Otherwise, this method returnsnull
.
Basically: ifisMemberOverride()
returnsfalse
, this returnsnull
.- Returns:
- Possibly-null related
Member
.
-
getRole
Role getRole()
If thisPermissionOverride
is an override dealing with aRole
, then this method will return the relatedRole
.
Otherwise, this method returnsnull
. Basically: ifisRoleOverride()
returnsfalse
, this returnsnull
.- Returns:
- Possibly-null related
Role
.
-
getChannel
Channel getChannel()
TheChannel
that thisPermissionOverride
affects.- Returns:
- Never-null related
Channel
that this override is part of.
-
getGuild
Guild getGuild()
TheGuild
that theChannel
returned fromgetChannel()
is a part of. By inference, this is theGuild
that thisPermissionOverride
is part of.- Returns:
- Never-null related
Guild
.
-
isMemberOverride
boolean isMemberOverride()
Used to determine if thisPermissionOverride
relates to a specificMember
.- Returns:
- True if this override is a user override.
-
isRoleOverride
boolean isRoleOverride()
Used to determine if thisPermissionOverride
relates to a specificRole
.- Returns:
- True if this override is a role override.
-
getManager
PermOverrideManager getManager()
Returns thePermOverrideManager
for this PermissionOverride.
In the PermOverrideManager you can modify the permissions of the override. You modify multiple fields in one request by chaining setters before callingRestAction.queue()
.- Returns:
- The PermOverrideManager of this override.
- Throws:
InsufficientPermissionException
- If the currently logged in account does not havePermission.MANAGE_CHANNEL
orPermission.MANAGE_PERMISSIONS
-
delete
@CheckReturnValue AuditableRestAction<java.lang.Void> delete()
Deletes this PermissionOverride.Possible ErrorResponses include:
ErrorResponse.UNKNOWN_OVERRIDE
If the the override was already deleted.UNKNOWN_CHANNEL
If the channel this override was a part of was already deletedMISSING_ACCESS
If we were removed from the Guild
- Returns:
AuditableRestAction
- Throws:
InsufficientPermissionException
- if we don't have the permission toMANAGE_CHANNEL
-
-