Class: Waylon::Conditions::PermissionDenied
- Inherits:
-
Waylon::Condition
- Object
- Waylon::Condition
- Waylon::Conditions::PermissionDenied
- Defined in:
- lib/waylon/conditions/permission_denied.rb
Overview
A pre-made catch-all condition for denying access
Instance Attribute Summary
Attributes inherited from Waylon::Condition
Instance Method Summary collapse
-
#initialize(*_args) ⇒ PermissionDenied
constructor
Overrides normal Condition initialization to force a specific action.
-
#matches?(_input) ⇒ Boolean
Matches any input (since the PermissionDenied route, when used, should always function).
-
#permits?(_user) ⇒ Boolean
Permits any user (since the PermissionDenied route, when used, should always function).
-
#tokens(input) ⇒ Array<String>
Just provides back all input as a single token.
Methods inherited from Waylon::Condition
#mention_only?, #named_tokens, #properly_mentions?
Constructor Details
#initialize(*_args) ⇒ PermissionDenied
Overrides normal Condition initialization to force a specific action
8 9 10 11 12 13 |
# File 'lib/waylon/conditions/permission_denied.rb', line 8 def initialize(*_args) # rubocop:disable Lint/MissingSuper @mechanism = nil @action = :denied @allowed_groups = [:everyone] @help = "This action is not allowed" end |
Instance Method Details
#matches?(_input) ⇒ Boolean
Matches any input (since the PermissionDenied route, when used, should always function)
17 18 19 |
# File 'lib/waylon/conditions/permission_denied.rb', line 17 def matches?(_input) true end |
#permits?(_user) ⇒ Boolean
Permits any user (since the PermissionDenied route, when used, should always function)
23 24 25 |
# File 'lib/waylon/conditions/permission_denied.rb', line 23 def permits?(_user) true end |
#tokens(input) ⇒ Array<String>
Just provides back all input as a single token
29 30 31 |
# File 'lib/waylon/conditions/permission_denied.rb', line 29 def tokens(input) [input] end |