public class SModuleHelper
extends java.lang.Object
Constructor and Description |
---|
SModuleHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
createAdminLinkForGroupIfNotExists(Usergroup group,
Appuser user)
this method will check if the user is already registered as admin of the
group, and else add it
|
static Authority |
createAuthorityIfNotExists(java.lang.String number,
java.lang.String name,
java.lang.String scope,
Domain domain)
This will check if the authority exists, and creates it, or updates secondary
fields if this has changed
|
static Domain |
createDomainIfNotExists(java.lang.String number,
Domain parentdomain) |
static void |
createGroupWithAuthorityIfNotExists(Authority authority,
Usergroup group)
creates a link between a group and an authority
|
static void |
createMemberLinkForGroupIfNotExists(Usergroup group,
Appuser user)
this method will check if the user is already registered as member of the
group, and else add it
|
static Usergroup |
createUserGroupIfNotExists(java.lang.String number,
java.lang.String description)
This method will create an usergroup
|
static Appuser |
createUserIfNotExists(java.lang.String objectnumber,
java.lang.String password,
java.lang.String email,
java.lang.String lastname,
java.lang.String firstname)
creates a local user (not managed in enterprise LDAP), typically an admin
|
public static void createGroupWithAuthorityIfNotExists(Authority authority, Usergroup group)
authority
- authority to link to the group (should be persisted)group
- group to link to the authority (should be persisted)public static Authority createAuthorityIfNotExists(java.lang.String number, java.lang.String name, java.lang.String scope, Domain domain)
the
- unique number, including prefix on modulename
- a clear namescope
- precision on the scope in clear textdomain
- parent domainpublic static Usergroup createUserGroupIfNotExists(java.lang.String number, java.lang.String description)
number
- the unique number, including prefix on module and domaindescription
- a clear text descriptionpublic static void createAdminLinkForGroupIfNotExists(Usergroup group, Appuser user)
group
- the group objectuser
- user to add as admin of the grouppublic static void createMemberLinkForGroupIfNotExists(Usergroup group, Appuser user)
group
- groupuser
- user to add if needed as member of the grouppublic static Domain createDomainIfNotExists(java.lang.String number, Domain parentdomain)
number
- number of the domainparentdomain
- parent domain in the domain hierarchypublic static Appuser createUserIfNotExists(java.lang.String objectnumber, java.lang.String password, java.lang.String email, java.lang.String lastname, java.lang.String firstname)
objectnumber
- user unique business idpassword
- passwordemail
- e-mail of the userlastname
- last name of the userfirstname
- first name of the user