lib/mogli/user.rb
# queries all extended permissions for this user for the current application
# caches a hash of permission names => boolean indicating if the user has
# granted the specified permission to this app
queries all extended permissions for this user for the current application
caches a hash of permission names => boolean indicating if the user has
granted the specified permission to this app
queries all extended permissions for this user for the current application caches a hash of permission names = > boolean indicating if the user has granted the specified permission to this app
def fetch_permissions
      fql = "SELECT #{ALL_EXTENDED_PERMISSIONS.map(&:to_s).join(',')} " +
            "FROM permissions " +
            "WHERE uid = #{self.id}"
      @extended_permissions = {}
      perms_query_result = client.fql_query(fql).first
      ALL_EXTENDED_PERMISSIONS.each do |perm|
        @extended_permissions[perm] = (perms_query_result[perm.to_s] == 1)
      end
    end
def fetch_permissions fql = "SELECT #{ALL_EXTENDED_PERMISSIONS.map(&:to_s).join(',')} " + "FROM permissions " + "WHERE uid = #{self.id}" @extended_permissions = { } perms_query_result = client . fql_query ( fql ) . first ALL_EXTENDED_PERMISSIONS . each do | perm | @extended_permissions [ perm ] = ( perms_query_result [ perm . to_s ] == 1 ) end end
queries all extended permissions for this user for the current application
caches a hash of permission names => boolean indicating if the user has
granted the specified permission to this app
queries all extended permissions for this user for the current application caches a hash of permission names = > boolean indicating if the user has granted the specified permission to this app