Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: How to give ASSIGN_MEMBERS permission to guest user
I dropped one portlet in public page , where guest user submit his tokenId after we show him his details and after confirmation , when he submit that details we create his account in Organisation . But his role is guest user so always we are getting User 20120 must have ASSIGN_MEMBERS permission for com.liferay.portal.kernel.model.Organization 296207 exception , so how can we give ASSIGN_MEMBERS permission to guest user
I honestly don't think what you are trying to accomplish here.
Please paste some code and show us, what fails. Please also tell us, which Liferay version you are using.
Please paste some code and show us, what fails. Please also tell us, which Liferay version you are using.
Hello Christoph Rabel
thanks for quick reply.
I am using Liferay 7
I am saving User record in 1 custom table
for each user I am sending 1 unique Id (tokenId) to his email
so , when he check his email and in that he click url
so he will came to public page of my site ..after we will show him his details like his name,his email,his phone,his role (e.g faculty,Student..)
after checking his information when he submit details then only we are creating his account in User_ table
so that time I am getting always exception
thanks for quick reply.
I am using Liferay 7
I am saving User record in 1 custom table
for each user I am sending 1 unique Id (tokenId) to his email
so , when he check his email and in that he click url
so he will came to public page of my site ..after we will show him his details like his name,his email,his phone,his role (e.g faculty,Student..)
after checking his information when he submit details then only we are creating his account in User_ table
so that time I am getting always exception
pradip choudhari:
I'm assuming (just to be sure) that you're creating this account through the proper API, not in the table directly.
...after checking his information when he submit details then only we are creating his account in User_ table
so that time I am getting always exception
An important part of Christoph's answer was the question for code: It's so much easier to point out issues when we talk about specific code. But it's good to have your usecase here as well.
I'm assuming that you're implementing this all in your custom portlet. Most likely you're using a remote service (where the class name ends in *Service but not in *LocalService): These are permission checked, thus the anonymous user would need to have permission to use the API in the way that you intend. However, this is a really bad idea, as part of the API is also available remotely - and especially the remote API.
In your custom code, you may do the permission check (against the token) yourself, then invoke the *LocalService. LocalServices in Liferay won't check permissions, but can only be invoked from within the same virtual machine - as is the case with your custom portlet.
Hello Sir for better understanding , I am attaching image .
and i am explaining my schenerio is ,I am having all User details that details I am showing as like below image .so when he click confirm that time using action req. I am submitting his all information and I am calling UserServiceUtil.addUserWithWorkflow() method to creating his account and storing records in User_ table
and i am explaining my schenerio is ,I am having all User details that details I am showing as like below image .so when he click confirm that time using action req. I am submitting his all information and I am calling UserServiceUtil.addUserWithWorkflow() method to creating his account and storing records in User_ table
Attachments:
pradip choudhari:
That's what I was talking about: First of all: You should prefer to use UserService directly (e.g. through OSGi), and no longer through UserServiceUtil starting in Liferay 7.
UserServiceUtil.addUserWithWorkflow()
However, UserService is the remote service, with permission checks. The one that led to your question "how do I grant an unauthenticated user the permission to assign members" (or, in this case, to create user accounts): You don't.
Instead, you'll do the permission check yourself (I'm assuming you already do), then go to UserLocalService, which doesn't check permissions.
Thanks Olaf Kock
UserLocalServiceUtil worked for me ..
UserLocalServiceUtil worked for me ..
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™