Make getBy* properly fallible

This commit is contained in:
Nadja von Reitzenstein Čerpnjak 2024-05-07 13:25:42 +02:00
parent d4e6d048e3
commit d49319fc26

View File

@ -18,15 +18,19 @@ interface Resources {
list @1 () -> ( resources :List(Resource) );
# Returns all resources that the user can currently disclose.
getByName @2 ( name :Text ) -> ( resource :Resource , dummy :UInt8 );
getByName @2 ( name :Text ) -> Fallible(Resource, GetError);
# Returns a NULL capability if the resource doesn't exist or a user doesn't have read permission for that resource.
getByUrn @3 ( urn :Text ) -> ( resource :Resource );
getByUrn @3 ( urn :Text ) -> Fallible(Resource, GetError);
# Returns a NULL capability if the resource doesn't exist or a user doesn't have read permission for that resource.
getByUrl @4 ( url :Text ) -> ( resource :Resource );
getByUrl @4 ( url :Text ) -> Fallible(Resource, GetError);
# Returns a NULL capability if the resource doesn't exist or a user doesn't have read permission for that resource.
struct GetError {
notFound @0 :Void;
}
acceptToken @5 ( token :SturdyRef, project :Project ) -> Fallible(Claim, AcceptTokenError);
acceptTokenSubstituteUser @7 ( token :SturdyRef, project :Project )