Getting Parse Username from other logged user - parse-platform

I'm making android app that uses Parse.com.
I have a subclass of ParseObject and one of the key (say for example "keyForPointingUser") of that object is some ParseUser.
I'm logged in as User a for example and in that particular parse object subclass I created pointing to user b. When calling
ParseObjectSubClass.get("keyForPointingUser").getUsername();
I get an exception
ParseObject has no data for this key...
though I see in Parse data in the web browser that my ParseSubclass has a Prase User in the "keyForPointingUser" key....
Any ideas?
Thank u in advance

a bit late to answer but i've faced what you had problem here and i solved it with including user class to query :
query.include("user");

Related

How to read a Google People api response object [updated]

I'm new to Google's API and I'm having trouble reading the content of a People contact.
To get the details of a particular contact, references show this code should work [Edit: I updated the personfields]:
profile = service.people().get(resourceName='people/c63810788897573286', personFields='names')
The resourceName is the ID of a particular contact (that ID will only work for someone with access to my account). The server grabs it correctly and returns this:
<googleapiclient.discovery.Resource object at 0x10fd183c8>
How do I read the content of this object? I can't figure out from the documentation
I want to print out the Name. I'm pretty new to APIs, so maybe there is a standard way to read an HTTP object or maybe it's something unique to Google's API. Thanks for any advice
I found an answer in another somewhat related StackOverflow. I needed to the add .execute() to the call
profile = service.people().get(resourceName='people/c63810788897573286', personFields='names').execute()

Do I have to store sentry public key in an .env file

Everything is more or less said in the title. When I start the sentry sdk I have a dsn string that I have to write in my code to initialize it. I was wondering if I can hardcode this string or if I have to store it somewhere else. I wonder if it is dangerous or not. Thanks in advance.
Example of initialization: Sentry.init("https://examplePublicKey#o0.ingest.sentry.io/0")
This is a public address. The DSN string only allows events to be sent to a Sentry project. It doesn't give access to retrieve any data from it nor it can be used to execute any operation on your behalf. If for some reason it gets abused (bogus events start coming in), you can easily discard that DSN and create a new one.

New column for a Parse object doesn't appear in Parse application core console

I already have an object called Permission in my Parse application. It has four properties, namely: targetObject, roles, operations and action which appear fine in the Parse application core console.
Now, I added one more property called type to the Permission object.
I am able to save the object and read back the type property in the retrieved objects but I am not able to see the new column type for this new property in the Parse application core console.
What do I need to do in order to see this new column in the console?
Try reloading the app from the drop down list of apps or signing back in.
As soon as you create a new column, simply refresh the webpage showing the Parse Data Explorer.. they are aware of this issue, but it is set as a low priority to correct.

User registration using Spring Hibernate jsp mySQL

My Applicatoin is based on Spring 3, Hibernate, JSP and MySQL DB
While registering user, I want to check if username exists in DB. What is the best way to achieve this? can someone please provide example or reference to other posts?
I have tried below stuff so far
On submit of a page, I have a service call in controller which returns user object (if username exists) otherwise null. i.e. "public User userService.getUser(userName)"
I dont know how to pass the message to jsp so posting this message
I am not sure if this is the correct approach? of not please suggest
better one
I'll make a ajax call to check the existence of user by calling the this function inside the controller, and display the appropriate message if the user already exist.
public boolean isUserExist(String userName)
{
return userDao.isExist(userName);
}

In CakePHP 1.3 is there any advantage of using $this->Controller->Session over $this->Session in a component?

I'm using a modified version of Felix Geisendörfer's SimpleAuth/SimpleAcl components that I've combined into a single Component, Simple_Authable.
I changed his startup() function to initialize() to not clutter the beforeFilter function in my app_controller.
One of the things that this component does is check who the active user is and if that user can't be found it either looks him up based on the primary User.id or uses 'guest'. Either way, the component uses $this->Controller->Session->write() to save the active user or guest information.
I'm also using Felix's Authsome plugin instead of the default CakePHP Auth component.
When I'm logging in, the active user is guest, obviously.
After I've submitted the form, the active user is still guest because the component's initialize() function is firing before everything else. Then, the Authsome plugin comes into play and validates my user as "root" and also calls $this->SimpleAuthable->setActiveUser($id, true); to force SimpleAuthable to update the active user information it is storing via $this->Controller->Session; Then I am redirected and my simple Session information and DebugKit's Session tab reflect that I am indeed the root user.
However, when I try to navigate to an 'admin' page, let's say /admin/users/index, lo and behold SimpleAuthable thinks I'm still a 'guest' user because when it performs a $this->Controller->Session->read() call to the key holding my user id, it is getting an empty response, i.e., the data stored on the previous page didn't persist.
Maybe there is something funky happening between Authsome & SimpleAuthable, but things look pretty straightforward and to my mind, $this->Controller->Session should be saving and persisting the data written to it.
So, I'm looking at refactoring all the calls to $this->Controller->Session and replacing them with $this->Session but first I wanted to throw this out to the community and see if anybody has seen anything similar and if so how did they resolve it.
Sincerely,
Christopher.
I found the problem... I'm also using Joshua McNeese's Permissionable plugin and I needed to disable it for the $this->Controller->{$this->userModel}->findById($id); in my SimpleAuthable component when I try to lookup the current active user.
Note to self: I would have caught this faster if I had some unit testing in place :(.

Resources