Class: Ckeditor::AttachmentFilePolicy
- Inherits:
-
ApplicationPolicy
- Object
- ApplicationPolicy
- Ckeditor::AttachmentFilePolicy
- Defined in:
- lib/generators/ckeditor/templates/action_policy/attachment_file_policy.rb,
lib/generators/ckeditor/templates/pundit_policy/attachment_file_policy.rb
Instance Attribute Summary collapse
-
#attachment ⇒ Object
readonly
Returns the value of attribute attachment.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
- #create? ⇒ Boolean
- #destroy? ⇒ Boolean
- #index? ⇒ Boolean
-
#initialize(user, attachment) ⇒ AttachmentFilePolicy
constructor
A new instance of AttachmentFilePolicy.
Constructor Details
#initialize(user, attachment) ⇒ AttachmentFilePolicy
Returns a new instance of AttachmentFilePolicy.
6 7 8 9 |
# File 'lib/generators/ckeditor/templates/pundit_policy/attachment_file_policy.rb', line 6 def initialize(user, ) @user = user @attachment = end |
Instance Attribute Details
#attachment ⇒ Object (readonly)
Returns the value of attribute attachment.
4 5 6 |
# File 'lib/generators/ckeditor/templates/pundit_policy/attachment_file_policy.rb', line 4 def @attachment end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
4 5 6 |
# File 'lib/generators/ckeditor/templates/pundit_policy/attachment_file_policy.rb', line 4 def user @user end |
Instance Method Details
#create? ⇒ Boolean
11 12 13 |
# File 'lib/generators/ckeditor/templates/action_policy/attachment_file_policy.rb', line 11 def create? user.present? end |
#destroy? ⇒ Boolean
15 16 17 |
# File 'lib/generators/ckeditor/templates/action_policy/attachment_file_policy.rb', line 15 def destroy? user.present? end |
#index? ⇒ Boolean
7 8 9 |
# File 'lib/generators/ckeditor/templates/action_policy/attachment_file_policy.rb', line 7 def index? user.present? end |