Class: TokenAuthenticateMe::UserPolicy
- Inherits:
-
ApplicationPolicy
- Object
- ApplicationPolicy
- TokenAuthenticateMe::UserPolicy
- Defined in:
- lib/generators/token_authenticate_me/policies/templates/user_policy.rb
Instance Method Summary collapse
- #create? ⇒ Boolean
- #destroy? ⇒ Boolean
- #permitted_attributes ⇒ Object
- #show? ⇒ Boolean
- #update? ⇒ Boolean
Instance Method Details
#create? ⇒ Boolean
3 4 5 |
# File 'lib/generators/token_authenticate_me/policies/templates/user_policy.rb', line 3 def create? true end |
#destroy? ⇒ Boolean
15 16 17 |
# File 'lib/generators/token_authenticate_me/policies/templates/user_policy.rb', line 15 def destroy? record.id == current_user.id || super end |
#permitted_attributes ⇒ Object
19 20 21 |
# File 'lib/generators/token_authenticate_me/policies/templates/user_policy.rb', line 19 def permitted_attributes [:username, :email, :password, :password_confirmation] end |
#show? ⇒ Boolean
7 8 9 |
# File 'lib/generators/token_authenticate_me/policies/templates/user_policy.rb', line 7 def show? true end |
#update? ⇒ Boolean
11 12 13 |
# File 'lib/generators/token_authenticate_me/policies/templates/user_policy.rb', line 11 def update? record.id == current_user.id || super end |