Class: Mogli::User
Defined Under Namespace
Classes: UnrecognizedExtendedPermissionException
Constant Summary
- 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
[ # 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, # page permissions :manage_pages ]
Instance Attribute Summary (collapse)
-
- (Object) extended_permissions
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)
-
- (Boolean) has_permission?(permission)
check if the facebook user has a specific permission.
Methods inherited from Profile
#image_url, #large_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, has_association, hash_populating_accessor, 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
- (Object) extended_permissions (readonly)
Returns the value of attribute extended_permissions
33 34 35 |
# File 'lib/mogli/user.rb', line 33 def @extended_permissions end |
Class Method Details
+ (Boolean) recognize?(hash)
9 10 11 |
# File 'lib/mogli/user.rb', line 9 def self.recognize?(hash) !hash.has_key?("category") end |
Instance Method Details
- (Boolean) has_permission?(permission)
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
88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/mogli/user.rb', line 88 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 |