mirror of
https://github.com/google/nomulus
synced 2026-01-06 21:47:31 +00:00
Decouple superuser from SessionMetadata
Superuser should only be settable via the tool (see [] which is merged in here but not diffbased, and which removes the implicit superuser for CharlestonRoad). It is a property of the request, not of the session (there are no sessions in the tool). ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=125204707
This commit is contained in:
@@ -61,7 +61,7 @@ public abstract class ResourceUpdateFlow
|
||||
for (StatusValue statusValue : Sets.union(
|
||||
command.getInnerAdd().getStatusValues(),
|
||||
command.getInnerRemove().getStatusValues())) {
|
||||
if (!superuser && !statusValue.isClientSettable()) { // The superuser can set any status.
|
||||
if (!isSuperuser && !statusValue.isClientSettable()) { // The superuser can set any status.
|
||||
throw new StatusNotClientSettableException(statusValue.getXmlName());
|
||||
}
|
||||
}
|
||||
@@ -85,7 +85,7 @@ public abstract class ResourceUpdateFlow
|
||||
protected final void verifyNewStateIsAllowed() throws EppException {
|
||||
// If the resource is marked with clientUpdateProhibited, and this update did not clear that
|
||||
// status, then the update must be disallowed (unless a superuser is requesting the change).
|
||||
if (!superuser
|
||||
if (!isSuperuser
|
||||
&& existingResource.getStatusValues().contains(StatusValue.CLIENT_UPDATE_PROHIBITED)
|
||||
&& newResource.getStatusValues().contains(StatusValue.CLIENT_UPDATE_PROHIBITED)) {
|
||||
throw new ResourceHasClientUpdateProhibitedException();
|
||||
|
||||
Reference in New Issue
Block a user