com.google.code.facebookapi
Enum Permission

java.lang.Object
  extended by java.lang.Enum<Permission>
      extended by com.google.code.facebookapi.Permission
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Permission>

public enum Permission
extends java.lang.Enum<Permission>

Enum for managing the different permission-types used by Facebook. These are opt-in permissions that the user must explicitly grant, and can only be requested one at a time. To request that a user grant you a permission, direct them to a URL of the form: http://www.facebook.com/authorize.php?api_key=[YOUR_API_KEY]&v=1.0&ext_perm=[PERMISSION NAME] You can query to see if the user has granted your application a given permission using the 'users.hasAppPermission' API call.

See Also:
http://wiki.developers.facebook.com/index.php/Extended_application_permission, , http://wiki.developers.facebook.com/index.php/Users.hasAppPermission

Enum Constant Summary
CREATE_EVENT
          This permission allows an app to create and modify events for a user via the events.create, events.edit and events.cancel methods.
CREATE_LISTING
          This permission allows an app to create and modify listings for a user via the marketplace.removeListing and marketplace.createListing methods.
EMAIL
          This permission allows an application to send email to its user.
MARKETPLACE_CREATE
          Deprecated. CREATE_LISTING
OFFLINE_ACCESS
          This permission grants an application access to user data when the user is offline or doesn't have an active session.
PHOTO_UPLOAD
          This permission relaxes requirements on the photos.upload and photos.addTag methods.
RSVP_EVENT
          This permission allows an app to RSVP to an event on behalf of a user via the events.rsvp method.
SMS_SEND
          This permissions allows a mobile application to send messages to the user and respond to messages from the user via text message.
STATUS_UPDATE
          This extended permission grants access to the users.setStatus method.
 
Field Summary
static java.lang.String PERM_AUTHORIZE_ADDR
          The unchanging part of the URL to use when authorizing permissions.
 
Method Summary
static java.lang.String authorizationUrl(java.lang.String apiKey, Permission permission)
          Compute the URL to which to send the user to request the extended permission.
 java.lang.String getName()
          Gets the name by which Facebook refers to this permission.
static Permission valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Permission[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

EMAIL

public static final Permission EMAIL
This permission allows an application to send email to its user. This permission can be obtained only through the fb:prompt-permission tag or the promptpermission attribute. When the user accepts, you can send him an email via Notifications.sendEmail or directly to the proxied_email FQL field.


OFFLINE_ACCESS

public static final Permission OFFLINE_ACCESS
This permission grants an application access to user data when the user is offline or doesn't have an active session. This permission can be obtained only through the fb:prompt-permission tag or the promptpermission attribute.


STATUS_UPDATE

public static final Permission STATUS_UPDATE
This extended permission grants access to the users.setStatus method.


PHOTO_UPLOAD

public static final Permission PHOTO_UPLOAD
This permission relaxes requirements on the photos.upload and photos.addTag methods. If the user grants this permission, photos uploaded by the application will bypass the pending state and the user will not have to manually approve the photos each time.


CREATE_LISTING

public static final Permission CREATE_LISTING
This permission allows an app to create and modify listings for a user via the marketplace.removeListing and marketplace.createListing methods. The user will not need to approve each listing individually.


CREATE_EVENT

public static final Permission CREATE_EVENT
This permission allows an app to create and modify events for a user via the events.create, events.edit and events.cancel methods.


RSVP_EVENT

public static final Permission RSVP_EVENT
This permission allows an app to RSVP to an event on behalf of a user via the events.rsvp method.


SMS_SEND

public static final Permission SMS_SEND
This permissions allows a mobile application to send messages to the user and respond to messages from the user via text message.


MARKETPLACE_CREATE

@Deprecated
public static final Permission MARKETPLACE_CREATE
Deprecated. CREATE_LISTING
Field Detail

PERM_AUTHORIZE_ADDR

public static final java.lang.String PERM_AUTHORIZE_ADDR
The unchanging part of the URL to use when authorizing permissions.

See Also:
Constant Field Values
Method Detail

values

public static final Permission[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(Permission c : Permission.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static Permission valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name

getName

public java.lang.String getName()
Gets the name by which Facebook refers to this permission. The name is what is sent in API calls and other requests to Facebook to specify the desired premission.

Returns:
the Facebook name given to this permission.

authorizationUrl

public static java.lang.String authorizationUrl(java.lang.String apiKey,
                                                Permission permission)
Compute the URL to which to send the user to request the extended permission.

Parameters:
apiKey - your application's API key.
permission - the permission you want the grant URL for.
Returns:
a String that specifies the URL to direct users to in order to grant this permission to the application.


Copyright © 2008. All Rights Reserved.