Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to activate experimenter with the omero-py admin service #420

Open
ArtemLogachov opened this issue Jul 10, 2024 · 2 comments
Open

How to activate experimenter with the omero-py admin service #420

ArtemLogachov opened this issue Jul 10, 2024 · 2 comments

Comments

@ArtemLogachov
Copy link

Hi, I use this code to create an Experimenter

exp = ExperimenterI()
exp.omeName = rstring(username)
exp.firstName = rstring(first_name if first_name else "")
exp.lastName = rstring(last_name if last_name else "")
exp.email = rstring(email if email else "")
exp.ldap = rbool(False)  # Set LDAP to False

group_name = "name"
group_obj = admin_service.lookupGroup(group_name)

default_group = ExperimenterGroupI(group_obj.id.val, False)
groups = [default_group]

# Save the experimenter
exp = admin_service.createExperimenterWithPassword(
    exp, rstring(password), default_group, groups
)
return exp

But after creating an experimenter it set active flag to false and user can not login to the OMERO admin

Is there any way on how I can make this user active with the admin service?

Thanks

@will-moore
Copy link
Member

You need to add the user to the user group:

groups = [default_group]
groups.append(admin_service.lookupGroup('user'))

@ArtemLogachov
Copy link
Author

Thanks for the fast answer! It helped

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants