CreateEndpoint
public protocol CreateEndpoint : AuthEndpoint
A special AuthEndpoint
used to provide a common interface for Create
components so they can access their own .auth
modifier.
-
auth(_:
Extension method) A modifier used to make sure components only authorize requests where the supplied user
U
is actually related to theQuerySubject
.Declaration
Swift
public func auth<U: CorvusModelAuthenticatable>( _ user: CreateAuthModifier<Self, U>.UserKeyPath ) -> CreateAuthModifier<Self, U>
Parameters
user
A
KeyPath
to the related user property.Return Value
An instance of a
CreateAuthModifier
with the suppliedKeyPath
to the user. -
auth(_:
Extension method_: ) A modifier used to make sure components only authorize requests where the supplied user
U
is actually related to theQuerySubject
.Declaration
Swift
public func auth<I: CorvusModel, U: CorvusModelAuthenticatable> ( _ intermediate: NestedCreateAuthModifier<Self, I, U>.IntermediateKeyPath, _ user: NestedCreateAuthModifier<Self, I, U>.UserKeyPath ) -> NestedCreateAuthModifier<Self, I, U>
Parameters
intermediate
A
KeyPath
to the intermediate property.user
A
KeyPath
to the related user property from the intermediate.Return Value
An instance of a
AuthModifier
with the suppliedKeyPath
to the user.