mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-04-01 18:00:12 +02:00
send default user type back to client
This commit is contained in:
@@ -77,12 +77,33 @@ public class ScmState
|
||||
WebSecurityContext securityContext,
|
||||
Collection<Type> repositoryTypes,
|
||||
ScmClientConfig clientConfig)
|
||||
{
|
||||
this(provider, securityContext, repositoryTypes, null, clientConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs {@link ScmState} object.
|
||||
*
|
||||
*
|
||||
* @param provider - context provider
|
||||
* @param securityContext - security context of the current user
|
||||
* @param repositoryTypes - available repository types
|
||||
* @param clientConfig - client configuration
|
||||
* @param defaultUserType = Default user type
|
||||
*
|
||||
* @since 1.14
|
||||
*/
|
||||
public ScmState(SCMContextProvider provider,
|
||||
WebSecurityContext securityContext,
|
||||
Collection<Type> repositoryTypes, String defaultUserType,
|
||||
ScmClientConfig clientConfig)
|
||||
{
|
||||
this.version = provider.getVersion();
|
||||
this.user = securityContext.getUser();
|
||||
this.groups = securityContext.getGroups();
|
||||
this.repositoryTypes = repositoryTypes;
|
||||
this.clientConfig = clientConfig;
|
||||
this.defaultUserType = defaultUserType;
|
||||
}
|
||||
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
@@ -98,6 +119,19 @@ public class ScmState
|
||||
return clientConfig;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the default user type
|
||||
*
|
||||
*
|
||||
* @return default user type
|
||||
*
|
||||
* @since 1.14
|
||||
*/
|
||||
public String getDefaultUserType()
|
||||
{
|
||||
return defaultUserType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a {@link java.util.Collection} of groups names which are associated
|
||||
* to the current user.
|
||||
@@ -168,6 +202,18 @@ public class ScmState
|
||||
this.clientConfig = clientConfig;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the default user type
|
||||
*
|
||||
*
|
||||
* @param defaultUserType default user type
|
||||
* @since 1.14
|
||||
*/
|
||||
public void setDefaultUserType(String defaultUserType)
|
||||
{
|
||||
this.defaultUserType = defaultUserType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for the groups.
|
||||
*
|
||||
@@ -231,6 +277,9 @@ public class ScmState
|
||||
/** Field description */
|
||||
private ScmClientConfig clientConfig;
|
||||
|
||||
/** Field description */
|
||||
private String defaultUserType;
|
||||
|
||||
/** Field description */
|
||||
private Collection<String> groups;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user