Hi,
Person objects in OpenSocial have a isOwner() function that you can call.
You can determine whether the current viewer is the owner by writing
something like:
function response(data) {
output("hi");
var viewer = data.get("req").getData();
var is_owner = viewer && viewer.isOwner() || false;
};
function request() {
var req = opensocial.newDataRequest();
req.add(req.newFetchPersonRequest(opensocial.DataRequest.PersonId.VIEWER),
"req");
req.send(response);
};
request();
Then the is_owner variable in the response() function will tell you whether
the viewer is the owner.
Hope this helps,
~Arne
On Thu, May 1, 2008 at 1:47 PM, zingbangzing <[EMAIL PROTECTED]> wrote:
>
> How do check if a user is owner?
>
> Example
>
> If( OWNER)
> {
> editable fields
> }
> else
> {
> static fields
> }
>
> Thank you!
> >
>
--
OpenSocial IRC - irc://irc.freenode.net/opensocial
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"OpenSocial Application Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/opensocial-api?hl=en
-~----------~----~----~----~------~----~------~--~---