Interface IPermissionContainerManager<T extends IPermissionContainer,M extends IPermissionContainerManager<T,M>>
- Type Parameters:
T
- The channel typeM
- The manager type
- All Superinterfaces:
AuditableRestAction<Void>
,ChannelManager<T,
,M> Manager<M>
,RestAction<Void>
- All Known Subinterfaces:
AudioChannelManager<T,
,M> CategoryManager
,ForumChannelManager
,ICategorizableChannelManager<T,
,M> IPostContainerManager<T,
,M> MediaChannelManager
,NewsChannelManager
,StageChannelManager
,StandardGuildChannelManager<T,
,M> StandardGuildMessageChannelManager<T,
,M> TextChannelManager
,VoiceChannelManager
public interface IPermissionContainerManager<T extends IPermissionContainer,M extends IPermissionContainerManager<T,M>>
extends ChannelManager<T,M>
Manager abstraction to modify
PermissionOverrides
of a permission containing channel
.-
Field Summary
Fields inherited from interface net.dv8tion.jda.api.requests.restaction.AuditableRestAction
MAX_REASON_LENGTH
Fields inherited from interface net.dv8tion.jda.api.managers.channel.ChannelManager
APPLIED_TAGS, ARCHIVED, AUTO_ARCHIVE_DURATION, AVAILABLE_TAGS, BITRATE, DEFAULT_LAYOUT, DEFAULT_REACTION, DEFAULT_SORT_ORDER, DEFAULT_THREAD_SLOWMODE, HIDE_MEDIA_DOWNLOAD_OPTIONS, INVITEABLE, LOCKED, NAME, NSFW, PARENT, PERMISSION, PINNED, POSITION, REGION, REQUIRE_TAG, SLOWMODE, TOPIC, TYPE, USERLIMIT
-
Method Summary
Modifier and TypeMethodDescriptionClears the overrides added viaputPermissionOverride(IPermissionHolder, Collection, Collection)
.Clears the overrides removed viaremovePermissionOverride(IPermissionHolder)
.putMemberPermissionOverride
(long memberId, long allow, long deny) Adds an override for the specified member with the provided raw bitmasks as allowed and denied permissions.default M
putMemberPermissionOverride
(long memberId, Collection<Permission> allow, Collection<Permission> deny) Adds an override for the specified member with the provided permission sets as allowed and denied permissions.putPermissionOverride
(IPermissionHolder permHolder, long allow, long deny) Adds an override for the specifiedIPermissionHolder
with the provided raw bitmasks as allowed and denied permissions.default M
putPermissionOverride
(IPermissionHolder permHolder, Collection<Permission> allow, Collection<Permission> deny) Adds an override for the specifiedIPermissionHolder
with the provided permission sets as allowed and denied permissions.putRolePermissionOverride
(long roleId, long allow, long deny) Adds an override for the specified role with the provided raw bitmasks as allowed and denied permissions.default M
putRolePermissionOverride
(long roleId, Collection<Permission> allow, Collection<Permission> deny) Adds an override for the specified role with the provided permission sets as allowed and denied permissions.removePermissionOverride
(long id) Removes thePermissionOverride
for the specified member or role ID.removePermissionOverride
(IPermissionHolder permHolder) Removes thePermissionOverride
for the specifiedIPermissionHolder
.Methods inherited from interface net.dv8tion.jda.api.requests.restaction.AuditableRestAction
reason
Methods inherited from interface net.dv8tion.jda.api.managers.channel.ChannelManager
getChannel, getGuild, reset, reset, setName
Methods inherited from interface net.dv8tion.jda.api.managers.Manager
deadline, reset, setCheck, timeout
Methods inherited from interface net.dv8tion.jda.api.requests.RestAction
addCheck, and, and, complete, complete, completeAfter, delay, delay, delay, delay, flatMap, flatMap, getCheck, getJDA, map, mapToResult, onErrorFlatMap, onErrorFlatMap, onErrorMap, onErrorMap, onSuccess, queue, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, submit, submit, submitAfter, submitAfter, zip
-
Method Details
-
clearOverridesAdded
Clears the overrides added viaputPermissionOverride(IPermissionHolder, Collection, Collection)
.- Returns:
- ChannelManager for chaining convenience
-
clearOverridesRemoved
Clears the overrides removed viaremovePermissionOverride(IPermissionHolder)
.- Returns:
- ChannelManager for chaining convenience
-
putPermissionOverride
@Nonnull @CheckReturnValue M putPermissionOverride(@Nonnull IPermissionHolder permHolder, long allow, long deny) Adds an override for the specifiedIPermissionHolder
with the provided raw bitmasks as allowed and denied permissions. If the permission holder already had an override on this channel it will be replaced instead.- Parameters:
permHolder
- The permission holderallow
- The bitmask to grantdeny
- The bitmask to deny- Returns:
- ChannelManager for chaining convenience
- Throws:
IllegalArgumentException
- If the provided permission holder isnull
InsufficientPermissionException
- If the currently logged in account does not havePermission.MANAGE_PERMISSIONS
in this channel, or tries to set permissions it does not have without havingPermission.MANAGE_PERMISSIONS
explicitly for this channel through an override.- See Also:
-
putPermissionOverride
@Nonnull @CheckReturnValue default M putPermissionOverride(@Nonnull IPermissionHolder permHolder, @Nullable Collection<Permission> allow, @Nullable Collection<Permission> deny) Adds an override for the specifiedIPermissionHolder
with the provided permission sets as allowed and denied permissions. If the permission holder already had an override on this channel it will be replaced instead.
Example:putPermissionOverride(guild.getSelfMember(), EnumSet.of(Permission.MESSAGE_SEND, Permission.VIEW_CHANNEL), null)
- Parameters:
permHolder
- The permission holderallow
- The permissions to grant, or nulldeny
- The permissions to deny, or null- Returns:
- ChannelManager for chaining convenience
- Throws:
IllegalArgumentException
- If the provided permission holder isnull
InsufficientPermissionException
- If the currently logged in account does not havePermission.MANAGE_PERMISSIONS
in this channel, or tries to set permissions it does not have without havingPermission.MANAGE_PERMISSIONS
explicitly for this channel through an override.- See Also:
-
putRolePermissionOverride
Adds an override for the specified role with the provided raw bitmasks as allowed and denied permissions. If the role already had an override on this channel it will be replaced instead.- Parameters:
roleId
- The ID of the role to set permissions forallow
- The bitmask to grantdeny
- The bitmask to deny- Returns:
- ChannelManager for chaining convenience
- Throws:
InsufficientPermissionException
- If the currently logged in account does not havePermission.MANAGE_PERMISSIONS
in this channel, or tries to set permissions it does not have without havingPermission.MANAGE_PERMISSIONS
explicitly for this channel through an override.- See Also:
-
putRolePermissionOverride
@Nonnull @CheckReturnValue default M putRolePermissionOverride(long roleId, @Nullable Collection<Permission> allow, @Nullable Collection<Permission> deny) Adds an override for the specified role with the provided permission sets as allowed and denied permissions. If the role already had an override on this channel it will be replaced instead.- Parameters:
roleId
- The ID of the role to set permissions forallow
- The permissions to grant, or nulldeny
- The permissions to deny, or null- Returns:
- ChannelManager for chaining convenience
- Throws:
InsufficientPermissionException
- If the currently logged in account does not havePermission.MANAGE_PERMISSIONS
in this channel, or tries to set permissions it does not have without havingPermission.MANAGE_PERMISSIONS
explicitly for this channel through an override.- See Also:
-
putMemberPermissionOverride
Adds an override for the specified member with the provided raw bitmasks as allowed and denied permissions. If the member already had an override on this channel it will be replaced instead.- Parameters:
memberId
- The ID of the member to set permissions forallow
- The bitmask to grantdeny
- The bitmask to deny- Returns:
- ChannelManager for chaining convenience
- Throws:
InsufficientPermissionException
- If the currently logged in account does not havePermission.MANAGE_PERMISSIONS
in this channel, or tries to set permissions it does not have without havingPermission.MANAGE_PERMISSIONS
explicitly for this channel through an override.- See Also:
-
putMemberPermissionOverride
@Nonnull @CheckReturnValue default M putMemberPermissionOverride(long memberId, @Nullable Collection<Permission> allow, @Nullable Collection<Permission> deny) Adds an override for the specified member with the provided permission sets as allowed and denied permissions. If the member already had an override on this channel it will be replaced instead.- Parameters:
memberId
- The ID of the member to set permissions forallow
- The permissions to grant, or nulldeny
- The permissions to deny, or null- Returns:
- ChannelManager for chaining convenience
- Throws:
InsufficientPermissionException
- If the currently logged in account does not havePermission.MANAGE_PERMISSIONS
in this channel, or tries to set permissions it does not have without havingPermission.MANAGE_PERMISSIONS
explicitly for this channel through an override.- See Also:
-
removePermissionOverride
Removes thePermissionOverride
for the specifiedIPermissionHolder
. If no override existed for this member or role, this does nothing.- Parameters:
permHolder
- The permission holder- Returns:
- ChannelManager for chaining convenience
- Throws:
IllegalArgumentException
- If the provided permission holder isnull
InsufficientPermissionException
- If the currently logged in account does not havePermission.MANAGE_PERMISSIONS
in this channel
-
removePermissionOverride
Removes thePermissionOverride
for the specified member or role ID. If no override existed for this member or role, this does nothing.- Parameters:
id
- The ID of the permission holder- Returns:
- ChannelManager for chaining convenience
- Throws:
InsufficientPermissionException
- If the currently logged in account does not havePermission.MANAGE_PERMISSIONS
in this channel
-