IHKPluginUserRightId.ktIUserRightId to define the IHK plugin's single access right. Provides a ProviderService inner class for Hibernate Search indexing and the right-right provider SPI.@Indexed
@TypeBinding(binder = TypeBinderRef(type = HibernateSearchUserRightIdTypeBinder::class))
enum class IHKPluginUserRightId(
override val id: String,
override val orderString: String,
override val i18nKey: String
) : IUserRightId {
IHK("PLUGIN_IHK", "plugin70", "plugins.ihk");
}
| Parameter | Value | Meaning |
|---|---|---|
id | "PLUGIN_IHK" | Unique identifier across all plugins; stored in the database for user-right assignments |
orderString | "plugin70" | Sort key for the UserEditPage rights table; pluginnn pattern ensures plugins sort after built-in rights |
i18nKey | "plugins.ihk" | Key for the right's display name in the UI; resolved via IHKI18nResources.properties |
The @Indexed and @TypeBinding annotations bind this enum to HibernateSearchUserRightIdTypeBinder, enabling full-text search across user-right assignments. When a Hibernate Search query scans PFUserDO entities for rights, this type binder knows how to index enum-based right IDs.
The inner class ProviderService implements RightRightIdProviderService, a Java SPI interface. Its getUserRightIds() method returns the enum entries via Arrays.asList(*entries.toTypedArray()). This is loaded by the ServiceLoader and contributes the IHK right to the global registry of all known user rights in the system.
class ProviderService : RightRightIdProviderService {
override fun getUserRightIds(): Collection<IUserRightId> {
return Arrays.asList<IUserRightId>(*entries.toTypedArray())
}
}
override val constructor properties.ProviderService inner class is registered in META-INF/services/org.projectforge.framework.persistence.api.RightRightIdProviderService (not shown but implied by the pattern), making plugin rights automatically discoverable without explicit registration code.PLUGIN_IHK), unlike ToDo which has PLUGIN_TODO. The enum pattern scales cleanly if future sub-rights are needed (e.g., PLUGIN_IHK_ADMIN).pluginNN (where NN is an incrementing number) ensures deterministic ordering in the rights administration table. IHK uses 70, placing it after earlier plugins like ToDo (plugin10).868d6abb7 2025 -> 2026 63081666f Source file headers: 2024-> 2025. 067a4cbb1 Migration stuff in progress... b1560ca43 Migration stuff in progress...