Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v2.0.0-milestone.3.5 #514

Merged
merged 71 commits into from
Apr 4, 2024
Merged
Changes from 1 commit
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
867d129
Merge pull request #496 from refinedmods/main
raoulvdberge Mar 16, 2024
b4490f2
feat: crowdin config file
raoulvdberge Mar 16, 2024
0b7f4cd
Merge pull request #497 from refinedmods/feat/GH-210/crowdin
raoulvdberge Mar 16, 2024
617f008
fix: crowdin commit message and pr label
raoulvdberge Mar 16, 2024
2ce6804
Merge pull request #499 from refinedmods/fix/GH-210/crowdincommits
raoulvdberge Mar 16, 2024
8ac58fa
chore: update translation Chinese Simplified from crowdin
raoulvdberge Mar 16, 2024
15de5ae
chore: update translation French from crowdin
raoulvdberge Mar 16, 2024
f723a5d
chore: update translation Spanish from crowdin
raoulvdberge Mar 16, 2024
60e1a9d
chore: update translation German from crowdin
raoulvdberge Mar 16, 2024
3e2599f
chore: update translation Polish from crowdin
raoulvdberge Mar 16, 2024
d63af11
chore: update translation Russian from crowdin
raoulvdberge Mar 16, 2024
ca5bc15
chore: update translation Portuguese, Brazilian from crowdin
raoulvdberge Mar 16, 2024
a401a3f
Merge pull request #500 from refinedmods/crowdin-translations
raoulvdberge Mar 16, 2024
4cfa4c1
chore: update translation Hungarian from crowdin
raoulvdberge Mar 16, 2024
4c58c4c
Merge pull request #501 from refinedmods/crowdin-translations
raoulvdberge Mar 16, 2024
9e4a0f4
docs: crowdin badge and link
raoulvdberge Mar 16, 2024
5944813
fix: wireless grid name not being correct in gui
raoulvdberge Mar 16, 2024
44bc06e
fix: minecraft version in issue template
raoulvdberge Mar 16, 2024
ea98e46
Merge pull request #504 from refinedmods/fix/GH-502/menutitle
raoulvdberge Mar 16, 2024
ea2c926
chore: update translation French from crowdin
raoulvdberge Mar 17, 2024
6637ba8
chore: update translation German from crowdin
raoulvdberge Mar 17, 2024
d468362
chore: update translation Italian from crowdin
raoulvdberge Mar 17, 2024
9f85777
chore: update translation Japanese from crowdin
raoulvdberge Mar 17, 2024
128cf80
chore: update translation Korean from crowdin
raoulvdberge Mar 17, 2024
fd4a30d
chore: update translation Dutch from crowdin
raoulvdberge Mar 17, 2024
c7b2891
chore: update translation Chinese Traditional from crowdin
raoulvdberge Mar 17, 2024
6249bbb
chore: update translation Indonesian from crowdin
raoulvdberge Mar 17, 2024
e161117
Merge pull request #505 from refinedmods/crowdin-translations
raoulvdberge Mar 17, 2024
6f768d8
chore: update translation Polish from crowdin
raoulvdberge Mar 18, 2024
0f950d2
chore: update translation Portuguese, Brazilian from crowdin
raoulvdberge Mar 18, 2024
4b3e59d
chore: update translation Indonesian from crowdin
raoulvdberge Mar 18, 2024
42bc76d
chore: update translation French from crowdin
raoulvdberge Mar 19, 2024
adc5a4f
chore: update translation Polish from crowdin
raoulvdberge Mar 19, 2024
1ed70f9
Merge pull request #506 from refinedmods/crowdin-translations
raoulvdberge Mar 19, 2024
1c9d66d
refactor: move network components to their related package instead of…
raoulvdberge Mar 16, 2024
4a57de7
feat: security primitives
raoulvdberge Mar 16, 2024
95f14db
docs: note about crowdin
raoulvdberge Mar 17, 2024
d47cae7
feat: security card item
raoulvdberge Mar 17, 2024
5d5b370
feat: security card screen
raoulvdberge Mar 23, 2024
52bbb3a
feat: security security logic
raoulvdberge Mar 31, 2024
c071fd6
feat: fallback security card
raoulvdberge Mar 31, 2024
3cabe48
Merge pull request #509 from refinedmods/feat/GH-86/security-card
raoulvdberge Mar 31, 2024
6753b30
refactor: remove duplicated mod name translation
raoulvdberge Mar 31, 2024
567ddaf
chore: add intellij word dictionary
raoulvdberge Apr 1, 2024
2a20052
chore: add intellij project icon
raoulvdberge Apr 1, 2024
cd941d7
chore: reduce logging level
raoulvdberge Apr 1, 2024
be52b74
refactor: remove default registry values
raoulvdberge Apr 1, 2024
f0da2e0
docs: add note about grid view settings that became global to changelog
raoulvdberge Apr 1, 2024
8d6f354
refactor: security card client communications should use platform per…
raoulvdberge Apr 1, 2024
3def5dd
chore: sonar issues
raoulvdberge Apr 1, 2024
8ce67c7
Merge pull request #510 from refinedmods/feat/GH-86/security-card-cle…
raoulvdberge Apr 1, 2024
4ae1b45
fix: security card not updating while gui is open because slots were …
raoulvdberge Apr 1, 2024
7975d13
feat: security manager block
raoulvdberge Apr 1, 2024
96f67d1
feat: security network component logic and security card api
raoulvdberge Apr 2, 2024
8f18bd5
feat: security manager screen
raoulvdberge Apr 2, 2024
0278b41
feat: security card energy usage
raoulvdberge Apr 2, 2024
981dd66
feat: security network component logic pt 2
raoulvdberge Apr 2, 2024
31566d3
ci: exclude rei properly from sonar duplication checking
raoulvdberge Apr 3, 2024
5334b8d
Merge pull request #511 from refinedmods/feat/GH-90/security-manager
raoulvdberge Apr 3, 2024
77366f2
feat: permission checking
raoulvdberge Apr 3, 2024
66afd6a
feat: open permission checking
raoulvdberge Apr 4, 2024
411e2df
feat: insert and extract permission checking
raoulvdberge Apr 4, 2024
43eae90
feat: build permission checking
raoulvdberge Apr 4, 2024
b87adbe
fix: activeness checking on the security manager
raoulvdberge Apr 4, 2024
295ec2f
fix: confusing directionality on security manager
raoulvdberge Apr 4, 2024
a60e8e9
fix: slight desync when transferring fallback card
raoulvdberge Apr 4, 2024
04f0cb4
chore: sonar issues
raoulvdberge Apr 4, 2024
9b32e83
fix: forgotten build check for item storage and fluid storage blocks
raoulvdberge Apr 4, 2024
147a90e
fix: being able to bypass security rules with rotating or dismantling
raoulvdberge Apr 4, 2024
9bf2e5e
Merge pull request #513 from refinedmods/feat/GH-90/permission-checks
raoulvdberge Apr 4, 2024
6181a47
chore: prepare release v2.0.0-milestone.3.5
raoulvdberge Apr 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: security network component logic and security card api
  • Loading branch information
raoulvdberge committed Apr 2, 2024
commit 96f67d13c75ac375655a96defba61c6b029e9ea0
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
- The Security Card can be bound to other (currently online) players via its GUI.
- The binding of a Security Card can now be cleared.
- The Security Card tooltip and GUI now show whether the permission has been touched/changed in any way.
- A global (fallback) permission set for a network can be defined using the Fallback Security Card instead of using an "unbound" Security Card.
- A global (fallback) permission set for a network can be defined using the Fallback Security Card (instead of using an "unbound" Security Card).
- Smooth scrolling, screen size and max row stretch are no longer Grid-specific settings, but are now global settings.

### Fixed
Original file line number Diff line number Diff line change
@@ -5,5 +5,14 @@
@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.5")
@FunctionalInterface
public interface SecurityDecisionProvider {
/**
* Returns the {@link SecurityDecision} for the given {@link Permission} and {@link SecurityActor}.
* If there is no {@link SecurityPolicy} for the given {@link SecurityActor}, the decision should
* be {@link SecurityDecision#PASS}.
*
* @param permission the permission
* @param actor the actor
* @return the security decision
*/
SecurityDecision isAllowed(Permission permission, SecurityActor actor);
}
Original file line number Diff line number Diff line change
@@ -7,5 +7,10 @@
@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.5")
@FunctionalInterface
public interface SecurityNetworkComponent extends NetworkComponent {
/**
* @param permission the permission
* @param actor the actor
* @return true if the actor is allowed to perform the action, false otherwise
*/
boolean isAllowed(Permission permission, SecurityActor actor);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.refinedmods.refinedstorage2.api.network.security;

import java.util.Collections;
import java.util.Set;

import org.apiguardian.api.API;

@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.5")
public record SecurityPolicy(Set<Permission> allowedPermissions) {
public static final SecurityPolicy EMPTY = new SecurityPolicy(Collections.emptySet());

public boolean isAllowed(final Permission permission) {
return allowedPermissions.contains(permission);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.refinedmods.refinedstorage2.api.network.impl.node.security;

import com.refinedmods.refinedstorage2.api.network.impl.storage.AbstractNetworkNode;
import com.refinedmods.refinedstorage2.api.network.security.Permission;
import com.refinedmods.refinedstorage2.api.network.security.SecurityActor;
import com.refinedmods.refinedstorage2.api.network.security.SecurityDecision;
import com.refinedmods.refinedstorage2.api.network.security.SecurityDecisionProvider;

public class SecurityDecisionProviderProxyNetworkNode extends AbstractNetworkNode implements SecurityDecisionProvider {
private final long energyUsage;
private final SecurityDecisionProvider delegate;

public SecurityDecisionProviderProxyNetworkNode(final long energyUsage, final SecurityDecisionProvider delegate) {
this.energyUsage = energyUsage;
this.delegate = delegate;
}

@Override
public long getEnergyUsage() {
return energyUsage;
}

@Override
public SecurityDecision isAllowed(final Permission permission, final SecurityActor actor) {
return delegate.isAllowed(permission, actor);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@ParametersAreNonnullByDefault
@FieldsAndMethodsAreNonnullByDefault
package com.refinedmods.refinedstorage2.api.network.impl.node.security;

import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault;

import javax.annotation.ParametersAreNonnullByDefault;
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.refinedmods.refinedstorage2.api.network.impl.security;

import com.refinedmods.refinedstorage2.api.network.security.Permission;
import com.refinedmods.refinedstorage2.api.network.security.SecurityActor;
import com.refinedmods.refinedstorage2.api.network.security.SecurityDecision;
import com.refinedmods.refinedstorage2.api.network.security.SecurityDecisionProvider;
import com.refinedmods.refinedstorage2.api.network.security.SecurityPolicy;

import java.util.HashMap;
import java.util.Map;

public class SecurityDecisionProviderImpl implements SecurityDecisionProvider {
private final Map<SecurityActor, SecurityPolicy> policyByActor = new HashMap<>();

public SecurityDecisionProviderImpl setPolicy(final SecurityActor actor, final SecurityPolicy policy) {
policyByActor.put(actor, policy);
return this;
}

@Override
public SecurityDecision isAllowed(final Permission permission, final SecurityActor actor) {
final SecurityPolicy policy = policyByActor.get(actor);
if (policy == null) {
return SecurityDecision.PASS;
}
return policy.isAllowed(permission) ? SecurityDecision.ALLOW : SecurityDecision.DENY;
}
}
Original file line number Diff line number Diff line change
@@ -1,44 +1,52 @@
package com.refinedmods.refinedstorage2.api.network.impl.security;

import com.refinedmods.refinedstorage2.api.core.CoreValidations;
import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer;
import com.refinedmods.refinedstorage2.api.network.security.Permission;
import com.refinedmods.refinedstorage2.api.network.security.SecurityActor;
import com.refinedmods.refinedstorage2.api.network.security.SecurityDecision;
import com.refinedmods.refinedstorage2.api.network.security.SecurityDecisionProvider;
import com.refinedmods.refinedstorage2.api.network.security.SecurityNetworkComponent;
import com.refinedmods.refinedstorage2.api.network.security.SecurityPolicy;

import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;

public class SecurityNetworkComponentImpl implements SecurityNetworkComponent {
private final Set<SecurityDecisionProvider> providers = new HashSet<>();
private final Set<SecurityDecisionProvider> providers = new LinkedHashSet<>();
private final SecurityPolicy defaultPolicy;

public SecurityNetworkComponentImpl(final SecurityPolicy defaultPolicy) {
this.defaultPolicy = defaultPolicy;
}

@Override
public void onContainerAdded(final NetworkNodeContainer container) {
// TODO: use getNode
if (container instanceof SecurityDecisionProvider provider) {
if (container.getNode() instanceof SecurityDecisionProvider provider) {
providers.add(provider);
}
}

@Override
public void onContainerRemoved(final NetworkNodeContainer container) {
// TODO: use getNode
if (container instanceof SecurityDecisionProvider provider) {
if (container.getNode() instanceof SecurityDecisionProvider provider) {
providers.remove(provider);
}
}

@Override
public boolean isAllowed(final Permission permission, final SecurityActor actor) {
for (final SecurityDecisionProvider provider : providers) {
final SecurityDecision decision = provider.isAllowed(permission, actor);
final SecurityDecision decision = CoreValidations.validateNotNull(
provider.isAllowed(permission, actor),
"Security decision provider must not return null"
);
if (decision == SecurityDecision.DENY) {
return false;
} else if (decision == SecurityDecision.ALLOW) {
return true;
}
}
return true;
return defaultPolicy.isAllowed(permission);
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package com.refinedmods.refinedstorage2.api.network.impl.security;

import com.refinedmods.refinedstorage2.api.network.impl.node.security.SecurityDecisionProviderProxyNetworkNode;
import com.refinedmods.refinedstorage2.api.network.node.NetworkNode;
import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer;
import com.refinedmods.refinedstorage2.api.network.security.Permission;
import com.refinedmods.refinedstorage2.api.network.security.SecurityActor;
import com.refinedmods.refinedstorage2.api.network.security.SecurityDecision;
import com.refinedmods.refinedstorage2.api.network.security.SecurityDecisionProvider;
import com.refinedmods.refinedstorage2.api.network.security.SecurityNetworkComponent;
import com.refinedmods.refinedstorage2.api.network.security.SecurityPolicy;

import java.util.Set;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -15,38 +16,100 @@

class SecurityNetworkComponentImplTest {
SecurityNetworkComponent sut;
SecurityDecisionProviderImpl securityDecisionProvider;

@BeforeEach
void setUp() {
sut = new SecurityNetworkComponentImpl();
sut = new SecurityNetworkComponentImpl(policy(TestPermissions.ALLOW_BY_DEFAULT));
securityDecisionProvider = new SecurityDecisionProviderImpl();
}

@Test
void shouldUseDefaultPolicyIfNoSecurityDecisionProvidersArePresent() {
// Act & assert
assertThat(sut.isAllowed(TestPermissions.ALLOW_BY_DEFAULT, TestActors.A)).isTrue();
assertThat(sut.isAllowed(TestPermissions.OTHER, TestActors.A)).isFalse();
}

@Test
void shouldUseDefaultPolicyIfANotConfiguredSecurityDecisionProviderIsPresent() {
// Arrange
sut.onContainerAdded(() -> new SecurityDecisionProviderProxyNetworkNode(0, securityDecisionProvider));

// Act & assert
assertThat(sut.isAllowed(TestPermissions.ALLOW_BY_DEFAULT, TestActors.A)).isTrue();
assertThat(sut.isAllowed(TestPermissions.OTHER, TestActors.A)).isFalse();
}

@Test
void shouldUseDefaultPolicyIfAConfiguredSecurityDecisionProviderIsPresentForAnotherActor() {
// Arrange
sut.onContainerAdded(() -> new SecurityDecisionProviderProxyNetworkNode(0, securityDecisionProvider));
securityDecisionProvider.setPolicy(TestActors.B, policy(TestPermissions.OTHER));

// Act & assert
assertThat(sut.isAllowed(TestPermissions.ALLOW_BY_DEFAULT, TestActors.A)).isTrue();
assertThat(sut.isAllowed(TestPermissions.OTHER, TestActors.A)).isFalse();
}

@Test
void everythingIsAllowedByDefault() {
void shouldDenyPermissionIfAConfiguredSecurityDecisionProviderIsPresentForTheActor() {
// Arrange
sut.onContainerAdded(() -> new SecurityDecisionProviderProxyNetworkNode(0, securityDecisionProvider));
securityDecisionProvider.setPolicy(TestActors.B, policy(TestPermissions.OTHER));

// Act & assert
sut.onContainerAdded(new TestContainer());
assertThat(sut.isAllowed(TestPermissions.A, TestActors.X)).isTrue();
assertThat(sut.isAllowed(TestPermissions.B, TestActors.Y)).isFalse();
sut.onContainerRemoved(new TestContainer());
assertThat(sut.isAllowed(TestPermissions.ALLOW_BY_DEFAULT, TestActors.B)).isFalse();
assertThat(sut.isAllowed(TestPermissions.OTHER, TestActors.B)).isTrue();
}

@Test
void shouldUseFirstSecurityDecisionProviderThatIsConfiguredForActor() {
// Arrange
sut.onContainerAdded(() -> new SecurityDecisionProviderProxyNetworkNode(0, new SecurityDecisionProviderImpl()
.setPolicy(TestActors.A, policy(TestPermissions.OTHER2))));

sut.onContainerAdded(() -> new SecurityDecisionProviderProxyNetworkNode(0, securityDecisionProvider));
securityDecisionProvider.setPolicy(TestActors.A, policy(TestPermissions.ALLOW_BY_DEFAULT)); // will be ignored
securityDecisionProvider.setPolicy(TestActors.B, policy(TestPermissions.OTHER));

// Act & assert
assertThat(sut.isAllowed(TestPermissions.ALLOW_BY_DEFAULT, TestActors.A)).isFalse();
assertThat(sut.isAllowed(TestPermissions.OTHER, TestActors.A)).isFalse();
assertThat(sut.isAllowed(TestPermissions.OTHER2, TestActors.A)).isTrue();

assertThat(sut.isAllowed(TestPermissions.ALLOW_BY_DEFAULT, TestActors.B)).isFalse();
assertThat(sut.isAllowed(TestPermissions.OTHER, TestActors.B)).isTrue();
assertThat(sut.isAllowed(TestPermissions.OTHER2, TestActors.B)).isFalse();
}

@Test
void shouldRemoveSecurityDecisionProvider() {
// Arrange
final NetworkNode node = new SecurityDecisionProviderProxyNetworkNode(0, securityDecisionProvider);
sut.onContainerAdded(() -> node);
securityDecisionProvider.setPolicy(TestActors.B, policy(TestPermissions.OTHER));

// Act
sut.onContainerRemoved(() -> node);
sut.onContainerAdded(() -> new SecurityDecisionProviderProxyNetworkNode(0, new SecurityDecisionProviderImpl()
.setPolicy(TestActors.B, policy(TestPermissions.OTHER2))));

// Assert
assertThat(sut.isAllowed(TestPermissions.ALLOW_BY_DEFAULT, TestActors.B)).isFalse();
assertThat(sut.isAllowed(TestPermissions.OTHER, TestActors.B)).isFalse();
assertThat(sut.isAllowed(TestPermissions.OTHER2, TestActors.B)).isTrue();
}

enum TestPermissions implements Permission {
A, B
ALLOW_BY_DEFAULT, OTHER, OTHER2
}

enum TestActors implements SecurityActor {
X, Y
A, B
}

private static class TestContainer implements SecurityDecisionProvider, NetworkNodeContainer {
@Override
public SecurityDecision isAllowed(final Permission permission, final SecurityActor actor) {
return permission == TestPermissions.A ? SecurityDecision.ALLOW : SecurityDecision.DENY;
}

@Override
public NetworkNode getNode() {
throw new RuntimeException();
}
private SecurityPolicy policy(final Permission... permissions) {
return new SecurityPolicy(Set.of(permissions));
}
}
Original file line number Diff line number Diff line change
@@ -4,6 +4,8 @@
import com.refinedmods.refinedstorage2.api.network.Network;
import com.refinedmods.refinedstorage2.api.network.NetworkComponent;
import com.refinedmods.refinedstorage2.api.network.energy.EnergyStorage;
import com.refinedmods.refinedstorage2.api.network.security.SecurityActor;
import com.refinedmods.refinedstorage2.api.network.security.SecurityPolicy;
import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
import com.refinedmods.refinedstorage2.platform.api.constructordestructor.ConstructorStrategyFactory;
import com.refinedmods.refinedstorage2.platform.api.constructordestructor.DestructorStrategyFactory;
@@ -47,6 +49,7 @@
import java.util.Set;

import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.AbstractContainerMenu;
@@ -183,4 +186,8 @@ EnergyStorage asBlockItemEnergyStorage(
BuiltinPermissions getBuiltinPermissions();

PlatformRegistry<PlatformPermission> getPermissionRegistry();

SecurityPolicy createDefaultSecurityPolicy();

SecurityActor createPlayerSecurityActor(ServerPlayer player);
}
Original file line number Diff line number Diff line change
@@ -4,6 +4,8 @@
import com.refinedmods.refinedstorage2.api.network.Network;
import com.refinedmods.refinedstorage2.api.network.NetworkComponent;
import com.refinedmods.refinedstorage2.api.network.energy.EnergyStorage;
import com.refinedmods.refinedstorage2.api.network.security.SecurityActor;
import com.refinedmods.refinedstorage2.api.network.security.SecurityPolicy;
import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
import com.refinedmods.refinedstorage2.platform.api.constructordestructor.ConstructorStrategyFactory;
import com.refinedmods.refinedstorage2.platform.api.constructordestructor.DestructorStrategyFactory;
@@ -48,6 +50,7 @@
import javax.annotation.Nullable;

import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.AbstractContainerMenu;
@@ -363,6 +366,16 @@ public PlatformRegistry<PlatformPermission> getPermissionRegistry() {
return ensureLoaded().getPermissionRegistry();
}

@Override
public SecurityPolicy createDefaultSecurityPolicy() {
return ensureLoaded().createDefaultSecurityPolicy();
}

@Override
public SecurityActor createPlayerSecurityActor(final ServerPlayer player) {
return ensureLoaded().createPlayerSecurityActor(player);
}

private PlatformApi ensureLoaded() {
if (delegate == null) {
throw new IllegalStateException("Platform API not loaded yet");
Original file line number Diff line number Diff line change
@@ -7,11 +7,26 @@

@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.5")
public interface PlatformPermission extends Permission {
/**
* @return the permission name
*/
Component getName();

/**
* @return a short description of the permission
*/
Component getDescription();

/**
* @return the name of the mod that adds this permission
*/
Component getOwnerName();

/**
* Determines whether this permission is allowed by default, when it is not configured (yet)
* in a Security Card.
*
* @return true if this permission is allowed by default, false otherwise
*/
boolean isAllowedByDefault();
}
Loading