Class: Mogli::User
Direct Known Subclasses
Defined Under Namespace
Classes: UnrecognizedExtendedPermissionException
Constant Summary collapse
- ALL_EXTENDED_PERMISSIONS =
the entire list of extended permissions the user is able to grant the application. the list should be kept in sync with developers.facebook.com/docs/authentication/permissions
[ # timeline :publish_actions, # publishing permissions :publish_stream, :create_event, :rsvp_event, :offline_access, :publish_checkins, # data permissions :user_about_me, :user_activities, :user_birthday, :user_education_history, :user_events, :user_groups, :user_hometown, :user_interests, :user_likes, :user_location, :user_notes, :user_online_presence, :user_photo_video_tags, :user_photos, :user_relationships, :user_relationship_details, :user_religion_politics, :user_status, :user_videos, :user_website, :user_work_history, :email, :read_friendlists, :read_insights, :read_mailbox, :read_requests, :read_stream, :xmpp_login, :ads_management, :user_checkins, :friends_likes, # page permissions :manage_pages ]
Instance Attribute Summary collapse
-
#extended_permissions ⇒ Object
readonly
Returns the value of attribute extended_permissions.
Attributes inherited from Model
Attributes included from Model::Search
Class Method Summary collapse
Instance Method Summary collapse
-
#has_permission?(permission) ⇒ Boolean
check if the facebook user has a specific permission.
-
#revoke_permission ⇒ Object
revoke all permissions for this user.
Methods inherited from Profile
#image_url, #large_image_url, #normal_image_url, #sized_image_url, #small_image_url, #square_image_url, #to_s
Methods inherited from Model
#==, add_creation_method, #client, #client=, creation_keys, creation_properties, define_properties, #destroy, #fetch, find, fql_mapping, has_association, hash_populating_accessor, hash_populating_accessor_with_default_field, included, #initialize, #merge!, #method_missing, #post_params, property, #warn_about_invalid_property
Methods included from Model::Search
Constructor Details
This class inherits a constructor from Mogli::Model
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Mogli::Model
Instance Attribute Details
#extended_permissions ⇒ Object (readonly)
Returns the value of attribute extended_permissions.
40 41 42 |
# File 'lib/mogli/user.rb', line 40 def @extended_permissions end |
Class Method Details
.recognize?(hash) ⇒ Boolean
10 11 12 |
# File 'lib/mogli/user.rb', line 10 def self.recognize?(hash) !hash.has_key?("category") end |
Instance Method Details
#has_permission?(permission) ⇒ Boolean
check if the facebook user has a specific permission. the permission arg is a symbol matching the facebook extended permission names exactly: developers.facebook.com/docs/authentication/permissions
99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/mogli/user.rb', line 99 def () if !ALL_EXTENDED_PERMISSIONS.include? raise UnrecognizedExtendedPermissionException, "The requested permission is not recognized as a facebook extended permission: '#{}'" end if !defined?(@extended_permissions) end [] end |
#revoke_permission ⇒ Object
revoke all permissions for this user
113 114 115 |
# File 'lib/mogli/user.rb', line 113 def client.delete("#{id}/permissions") end |