Package omero.gateway.facility
Class AdminFacility
- java.lang.Object
-
- omero.gateway.facility.Facility
-
- omero.gateway.facility.AdminFacility
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAdminPrivileges(SecurityContext ctx, ExperimenterData user, java.util.Collection<java.lang.String> privileges)
Grant an user additional admin privileges.ExperimenterData
createExperimenter(SecurityContext ctx, ExperimenterData exp, java.lang.String username, java.lang.String password, java.util.List<GroupData> groups, boolean isAdmin, boolean isGroupOwner)
Creates an experimenter and returns it.ExperimenterData
createExperimenter(SecurityContext ctx, ExperimenterData exp, java.lang.String username, java.lang.String password, java.util.List<GroupData> groups, boolean isAdmin, boolean isGroupOwner, java.util.List<java.lang.String> privileges)
Creates an experimenter and returns it.GroupData
createGroup(SecurityContext ctx, GroupData groupData, ExperimenterData owner, int permissions)
Creates a group and returns it.java.util.Collection<java.lang.String>
getAdminPrivileges(SecurityContext ctx)
Get the logged in user's admin privileges (see omero.model.enums)java.util.Collection<java.lang.String>
getAdminPrivileges(SecurityContext ctx, ExperimenterData user)
Get the admin privileges of a certain user (see omero.model.enums)java.util.Collection<java.lang.String>
getAvailableAdminPrivileges(SecurityContext ctx)
Get all available admin privilegesboolean
isFullAdmin(SecurityContext ctx)
Checks if the currently logged in user has full admin privilegesboolean
isFullAdmin(SecurityContext ctx, ExperimenterData user)
Checks if a user has full admin privilegesExperimenterData
lookupExperimenter(SecurityContext ctx, java.lang.String name)
Returns the experimenter corresponding to the passed name ornull
.GroupData
lookupGroup(SecurityContext ctx, java.lang.String name)
Returns the group corresponding to the passed name ornull
.void
removeAdminPrivileges(SecurityContext ctx, ExperimenterData user, java.util.Collection<java.lang.String> privileges)
Revoke admin privileges for a uservoid
setAdminPrivileges(SecurityContext ctx, ExperimenterData user, java.util.Collection<java.lang.String> privileges)
Set the admin privileges of a certain user (see omero.model.enums)-
Methods inherited from class omero.gateway.facility.Facility
addPropertyChangeListener, clear, firePropertyChanged, firePropertyChanged, getFacility, logDebug, logError, logInfo, logWarn, removePropertyChangeListener
-
-
-
-
Method Detail
-
createGroup
public GroupData createGroup(SecurityContext ctx, GroupData groupData, ExperimenterData owner, int permissions) throws DSOutOfServiceException, DSAccessException
Creates a group and returns it.- Parameters:
ctx
- The security context.groupData
- Host information about the group to create.owner
- The owner of the group.permissions
- The group's permissions.- Returns:
- See above.
- Throws:
DSOutOfServiceException
- If the connection is broken, or not logged in.DSAccessException
- If an error occurred while trying to retrieve data from OMERO service.
-
createExperimenter
public ExperimenterData createExperimenter(SecurityContext ctx, ExperimenterData exp, java.lang.String username, java.lang.String password, java.util.List<GroupData> groups, boolean isAdmin, boolean isGroupOwner) throws DSOutOfServiceException, DSAccessException
Creates an experimenter and returns it.- Parameters:
ctx
- The security context.exp
- The experimenter to create.username
- The user name to use.password
- The password to use.groups
- The groups to add the user to.isAdmin
- Passtrue
if the user is an administrator,false
otherwise.isGroupOwner
- Passtrue
if the user is a group owner,false
otherwise.- Returns:
- See above.
- Throws:
DSOutOfServiceException
- If the connection is broken, or not logged in.DSAccessException
- If an error occurred while trying to retrieve data from OMERO service.
-
createExperimenter
public ExperimenterData createExperimenter(SecurityContext ctx, ExperimenterData exp, java.lang.String username, java.lang.String password, java.util.List<GroupData> groups, boolean isAdmin, boolean isGroupOwner, java.util.List<java.lang.String> privileges) throws DSOutOfServiceException, DSAccessException
Creates an experimenter and returns it.- Parameters:
ctx
- The security context.exp
- The experimenter to create.username
- The user name to use.password
- The password to use.groups
- The groups to add the user to.isAdmin
- Passtrue
if the user is an administrator,false
otherwise.isGroupOwner
- Passtrue
if the user is a group owner,false
otherwise.privileges
- Only grant these admin privileges (only applies if isAdmin ==true
); pass an empty list to create a user in system group but no admin privileges (unspecified ornull
creates full admin with all privileges)- Returns:
- See above.
- Throws:
DSOutOfServiceException
- If the connection is broken, or not logged in.DSAccessException
- If an error occurred while trying to retrieve data from OMERO service.
-
lookupGroup
public GroupData lookupGroup(SecurityContext ctx, java.lang.String name) throws DSOutOfServiceException, DSAccessException
Returns the group corresponding to the passed name ornull
.- Parameters:
ctx
- The security context.name
- The name of the group.- Returns:
- See above
- Throws:
DSOutOfServiceException
- If the connection is broken, or not logged in.DSAccessException
- If an error occurred while trying to retrieve data from OMERO service.
-
lookupExperimenter
public ExperimenterData lookupExperimenter(SecurityContext ctx, java.lang.String name) throws DSOutOfServiceException, DSAccessException
Returns the experimenter corresponding to the passed name ornull
.- Parameters:
ctx
- The security context.name
- The name of the experimenter.- Returns:
- See above
- Throws:
DSOutOfServiceException
- If the connection is broken, or not logged in.DSAccessException
- If an error occurred while trying to retrieve data from OMERO service.
-
getAdminPrivileges
public java.util.Collection<java.lang.String> getAdminPrivileges(SecurityContext ctx) throws DSOutOfServiceException, DSAccessException
Get the logged in user's admin privileges (see omero.model.enums)- Parameters:
ctx
- The security context.- Returns:
- See above
- Throws:
DSOutOfServiceException
- If the connection is broken, or not logged inDSAccessException
- If an error occurred while trying to retrieve data from OMERO service.
-
getAdminPrivileges
public java.util.Collection<java.lang.String> getAdminPrivileges(SecurityContext ctx, ExperimenterData user) throws DSOutOfServiceException, DSAccessException
Get the admin privileges of a certain user (see omero.model.enums)- Parameters:
ctx
- The security context.user
- The user.- Returns:
- See above
- Throws:
DSOutOfServiceException
- If the connection is broken, or not logged in.DSAccessException
- If an error occurred while trying to retrieve data from OMERO service.
-
setAdminPrivileges
public void setAdminPrivileges(SecurityContext ctx, ExperimenterData user, java.util.Collection<java.lang.String> privileges) throws DSOutOfServiceException, DSAccessException
Set the admin privileges of a certain user (see omero.model.enums)- Parameters:
ctx
- The security context.user
- The user.privileges
- The admin privileges.- Throws:
DSOutOfServiceException
- If the connection is broken, or not logged in.DSAccessException
- If an error occurred while trying to retrieve data from OMERO service.
-
addAdminPrivileges
public void addAdminPrivileges(SecurityContext ctx, ExperimenterData user, java.util.Collection<java.lang.String> privileges) throws DSOutOfServiceException, DSAccessException
Grant an user additional admin privileges.- Parameters:
ctx
- The security context.user
- The user.privileges
- The admin privileges to grant.- Throws:
DSOutOfServiceException
- If the connection is broken, or not logged in.DSAccessException
- If an error occurred while trying to retrieve data from OMERO service.
-
removeAdminPrivileges
public void removeAdminPrivileges(SecurityContext ctx, ExperimenterData user, java.util.Collection<java.lang.String> privileges) throws DSOutOfServiceException, DSAccessException
Revoke admin privileges for a user- Parameters:
ctx
- The security context.user
- The user.privileges
- The admin privileges to revoke.- Throws:
DSOutOfServiceException
- If the connection is broken, or not logged in.DSAccessException
- If an error occurred while trying to retrieve data from OMERO service.
-
getAvailableAdminPrivileges
public java.util.Collection<java.lang.String> getAvailableAdminPrivileges(SecurityContext ctx) throws DSOutOfServiceException, DSAccessException
Get all available admin privileges- Parameters:
ctx
- The security context.- Returns:
- See above.
- Throws:
DSOutOfServiceException
- If the connection is broken, or not logged in.DSAccessException
- If an error occurred while trying to retrieve data from OMERO service.
-
isFullAdmin
public boolean isFullAdmin(SecurityContext ctx) throws DSOutOfServiceException, DSAccessException
Checks if the currently logged in user has full admin privileges- Parameters:
ctx
- The security context.- Returns:
- See above.
- Throws:
DSOutOfServiceException
- If the connection is broken, or not logged in.DSAccessException
- If an error occurred while trying to retrieve data from OMERO service.
-
isFullAdmin
public boolean isFullAdmin(SecurityContext ctx, ExperimenterData user) throws DSOutOfServiceException, DSAccessException
Checks if a user has full admin privileges- Parameters:
ctx
- The security context.user
- The user.- Returns:
- See above.
- Throws:
DSOutOfServiceException
- If the connection is broken, or not logged in.DSAccessException
- If an error occurred while trying to retrieve data from OMERO service.
-
-