-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Because a Red::Model isn't quite the right type of, er, type the pattern suggested in the https://cro.services/docs/http-auth-and-sessions to create subsets of the UserSession object like:
subset Admin of My::App::Session where .is-admin;
subset LoggedIn of My::App::Session where .is-logged-in;
Won't work directly (giving The 'of' type of a subset must either be a valid nominal type or a type that can provide one ) so one has to make an intermediate subset instead like:
subset UserSession of Cro::HTTP::Auth where * ~~ My::App::Session;
subset Admin of UserSession where .is-admin;
subset LoggedIn of UserSession where .is-logged-in;
(Assuming My::App::Session is your Red model.)
I don't think this can easily be fixed given the way Red works (and would have to be done in Red itself besides,) but is probably worth noting in the documentation to avoid a future issue.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels