Package ca.cdr.api.security.permission
Interface PermissionArgumentFormat<F extends PermissionArgumentValue>
- Type Parameters:
F- The type this format parses/formats
public interface PermissionArgumentFormat<F extends PermissionArgumentValue>
Public interface for the various permission argument formats.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfacestatic interfacethe permission is scoped to a compartmentstatic interfacestatic interfacestatic interfacestatic interfacestatic interfaceThe permission is scoped to a single instancestatic interfacestatic interfacestatic interfaceThe permission has an optional FHIR filterstatic interfaceEmpty marker for facets of permission argumentsstatic interfaceThe permission is scoped to only apply to a typestatic interface -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic GrantedAuthorityJsonbuildAuthority(PermissionEnum thePermissionEnum, PermissionArgumentValue theArgumentValue) Typesafe authority builder.format the value back into a string for persistence.default <T extends PermissionArgumentValue>
StringformatIfValid(T theArgument) default StringgetDescription(ILocalizer theLocalizer) default StringgetName(ILocalizer theLocalizer) getType()Parse a permission argument string.
-
Field Details
-
FILTER_DELIMITER
- See Also:
-
TYPE_COMPARTMENT_DELIMITER
- See Also:
-
RESOURCE_TYPE_LIST_DELIMITER
- See Also:
-
RESOURCE_TYPE_PATTERN
- See Also:
-
ID_FORMAT
format for resource ids - used for compartments. The spec says [a-zA-Z0-9.\-]{1,36}, but hybrid might do any crazy thing, so we only verify we don't have any of our permission-format chars.- See Also:
-
-
Method Details
-
buildAuthority
static GrantedAuthorityJson buildAuthority(@Nonnull PermissionEnum thePermissionEnum, @Nonnull PermissionArgumentValue theArgumentValue) Typesafe authority builder. Validates the argument format against the declared format for thePermissionEnum- Parameters:
thePermissionEnum- the permissiontheArgumentValue- the concrete parsed argument type - useNoArgument.INSTANCEfor no-arg.
-
parse
@Nonnull Optional<F> parse(@Nullable String theArgumentString, @Nonnull ca.cdr.api.security.permission.IdBuilder theIdBuilder) Parse a permission argument string.- Parameters:
theArgumentString- The string to parse. null is treated as empty.theIdBuilder- factory for parsing IIdType types- Returns:
- the parsed arg value if the input matches this format
-
formatIfValid
-
getType
- Returns:
- the type of the value bean we parse
-
format
format the value back into a string for persistence.- Parameters:
theArgument- the arg value bean- Returns:
- the formatted string - empty will be the empty string, not null
-
getName
- Returns:
- the name of the argument format
-
getDescription
- Returns:
- A description of the argument format that users can use to properly format arguments
-