2018-06-29 17:10:14 +02:00
|
|
|
package sonia.scm.repository;
|
|
|
|
|
|
2018-07-04 15:46:08 +02:00
|
|
|
import org.apache.shiro.SecurityUtils;
|
2018-06-29 17:10:14 +02:00
|
|
|
import sonia.scm.plugin.Extension;
|
|
|
|
|
|
2018-07-13 12:10:19 +02:00
|
|
|
/**
|
|
|
|
|
* The DefaultNamespaceStrategy returns the username of the currently logged in user as namespace.
|
|
|
|
|
* @since 2.0.0
|
|
|
|
|
*/
|
2018-06-29 17:10:14 +02:00
|
|
|
@Extension
|
2018-07-04 15:46:08 +02:00
|
|
|
public class DefaultNamespaceStrategy implements NamespaceStrategy {
|
|
|
|
|
|
2018-06-29 17:10:14 +02:00
|
|
|
@Override
|
|
|
|
|
public String getNamespace() {
|
2018-07-13 12:10:19 +02:00
|
|
|
return SecurityUtils.getSubject().getPrincipal().toString();
|
2018-06-29 17:10:14 +02:00
|
|
|
}
|
|
|
|
|
}
|