Skip to content

Commit

Permalink
Merge branch 'develop' into feature/sbi/SIRI-880
Browse files Browse the repository at this point in the history
# Conflicts:
#	pom.xml
  • Loading branch information
sabieber committed Sep 28, 2023
2 parents a9ed0de + 89450ac commit 2d0e3a4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.scireum</groupId>
<artifactId>sirius-parent</artifactId>
<version>10.2.0</version>
<version>10.2.1</version>
</parent>
<artifactId>sirius-biz</artifactId>
<version>DEVELOPMENT-SNAPSHOT</version>
Expand All @@ -17,9 +17,9 @@
<url>http://www.sirius-lib.net</url>

<properties>
<sirius.kernel>dev-38.2.0</sirius.kernel>
<sirius.kernel>dev-38.3.0</sirius.kernel>
<sirius.web>dev-71.0.0</sirius.web>
<sirius.db>dev-54.2.1</sirius.db>
<sirius.db>dev-54.2.2</sirius.db>
</properties>

<repositories>
Expand Down
20 changes: 13 additions & 7 deletions src/main/java/sirius/biz/tycho/smart/TenantSmartValueProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import sirius.kernel.commons.Strings;
import sirius.kernel.di.std.Part;
import sirius.kernel.di.std.Register;
import sirius.kernel.nls.NLS;
import sirius.web.security.UserContext;
import sirius.web.security.UserInfo;

Expand Down Expand Up @@ -40,17 +41,22 @@ public void collectValues(String type, Object payload, Consumer<SmartValue> valu
}

UserInfo currentUser = UserContext.getCurrentUser();
if (!currentUser.hasPermission("permission-select-tenant")) {
return;
}
if (Strings.areEqual(tenant.getIdAsString(), currentUser.getTenantId())) {
return;
}
if (currentUser.hasPermission("permission-select-tenant")) {
valueCollector.accept(new SmartValue("fa-solid fa-exchange-alt",
NLS.get("TenantController.select"),
"/tenants/select/" + tenant.getIdAsString(),
null));
}

valueCollector.accept(new SmartValue("fa fa-exchange-alt",
tenant.getTenantData().getName(),
"/tenants/select/" + tenant.getIdAsString(),
null));
if (currentUser.hasPermission("permission-manage-tenants")) {
valueCollector.accept(new SmartValue("fa-solid fa-pen-to-square",
NLS.get("TenantController.edit"),
"/tenant/" + tenant.getIdAsString(),
null));
}
}

@Override
Expand Down

0 comments on commit 2d0e3a4

Please sign in to comment.