How to configure permission to assign course in moodle API? - moodle-api

In moodle 3.6 the enrol_manual_enrol_user does not work every time!
{
"exception": "moodle_exception",
"errorcode": "wsusercannotassign",
"message": "You don't have the permission to assign this role (383) to this user (2) in this course(28)."
}

I fell in the same error message.
If someone faced it, the permission to give to your integration user is:
moodle/role:assign
That solve the "wsusercannotassign" problem.

It took me two days to find a way to solve this problem.
In my case the web service user had all required privileges to enroll a user. The confusing thing was that the same web service user was able to create a new moodle user via the API.
After checking all those role specific right ("allow roles assignments", "allow role overrides", "allow role switches") multiple times I found one relevant hint in a tutorial: the user who wants to enroll another user to a course has to be member of this course (?!?).
So I put my web service user to each course I have and gave him in addition the "trainer"-role. And now enrollment works even via the API.

Related

get first and last name from e-mail address in Enterprise G-Suite

I am trying to find a user's name from their e-mail address. I thought I could use People.People.get as mentioned here but that requires knowing the user's account ID.
How can I get information about the user if I only know their e-mail?
And I don't think I can use the Directory API cause I don't have admin access.
You can use Admin Directory API to get user's details. While making the URL call, you need to specify a parameter in the request body which is (viewType:"domain_public"), so you will get the basic details of the user in your domain without having admin rights.
Reference Link : https://developers.google.com/admin-sdk/directory/v1/reference/users/get
I don't think you can do it without Admin Rights, on the link you mentioned you need the AccountId which can only be retrieved by having Admin Rights and Access to the Directory API (https://developers.google.com/admin-sdk/directory/v1/reference/users/get) which you mentioned tyou don't have access to.
You could ask to your Administrator to get an Admin Role https://support.google.com/a/answer/172176?hl=en to use the Admin SDK for complete your task, it will be easier for you. The other way I don't know how the contact sharing is setup in your organization because you should be able to check the information of the contact when sending an email or adding it to your contact list.
I hope this information can be of help. Greetings.

Create Keyrock users for WStore and WMarket

I'd like to programmatically create user accounts from our own app/api and got to the point I can indeed add users to my local Keyrock (a fork of Keystone) instance. Unfortunately these users remain useless because they get automatically logged out the moment they are successfully logged in.
Can anyone let me know what are the minimum user account properties needed to successfully login a user to WStore?
TIA, Edoardo
This question is the same than the one posted on https://ask.fiware.org/question/441/programmatically-create-keyrock-users-for-wstore-and-wmarket-etc/. Please, let's continue there.

Can loggin only as Builtin/Administrator

What I've done is:
Turned UAC policy off
Added local/domain user to the Administrators group via localhost/Reports
Added the user to users list of SSRS DB.
Result: I can only login to localhost/ReportServer as Adminstrator, not any other user.
Error message:
The permissions granted to user 'mydomain\myAccount' are insufficient for performing this operation. (rsAccessDenied)
However I can login to localhost/Reports and edit Site Settings.
I tried pretty everything from what I found in Google, but nothing help me out. What am I missing?
Just needed to add the user to Folder Settings with all roles (click Role checkbox). I knew I was missing something trivial.

Azure API Management Sign Up Stuck In Process

I'm using Azure API Management and I have a user who tried to sign up but never got the "validation" email. Let's just assume the email is not recoverable. Unfortunately, I have no way to reset that user's email address. The API Management framework knows that the email already exists but I have no visibility to that user's profile until they validate the account. At that point I can manage their account but, until then, they are in-limbo.
If the user tries to re-sign up or even if I send an invite, we get an error that says. "Email already exist"
Any pointers?
The confirmation request will expire in 2 days, so if the user tries again after 2 days, the "email already exist" error should go away.
Meanwhile, we are currently working on a feature to allow Admins to delete unconfirmed users from the Management Console.
In addition to allowing admins to remove unconfirmed users we added the ability for users to re-send confirmation email.

How do I SILENTLY create external user under enterprise account? No invite

Is there a way to create an external user account under an enterprise account silently, where there is no accept/email invite needed?
Use Case:
User becomes a member of our web site, we call API and provision grant them silently which creates an external user under our enterprise account.
Any code axample? Silently and without invite is the key thing here. Thanks!
There isn't a way to do this. The user doesn't have a password at creation time and needs to set one by going to the website via the email confirmation link.
Could you perhaps explain why you don't want the email to be sent, and what your user workflow looks like?