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
Modifier and TypeInterfaceDescriptionstatic interface
static interface
the permission is scoped to a compartmentstatic interface
static interface
static interface
static interface
static interface
The permission is scoped to a single instancestatic interface
static interface
static interface
The permission has an optional FHIR filterstatic interface
Empty marker for facets of permission argumentsstatic interface
The permission is scoped to only apply to a type -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic GrantedAuthorityJson
buildAuthority
(PermissionEnum thePermissionEnum, PermissionArgumentValue theArgumentValue) Typesafe authority builder.format the value back into a string for persistence.default <T extends PermissionArgumentValue>
StringformatIfValid
(T theArgument) 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.INSTANCE
for 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
-