Skip to main content

parse_roles

Function parse_roles 

Source
pub fn parse_roles(roles: &str) -> Box<[Box<str>]>
Expand description

The single parser for comma-separated role strings, re-exported for core-side callers. Empty segments must be dropped — see the definition for why. Parse a comma-separated role list into the shape AuthCtx::roles expects.

Empty segments are dropped, because "".split(',') yields one empty item and a "" entry reads as “has a role” in file_access::role_access_level, granting every federated stranger access to tenant-owned files. Every conversion from a stored/claimed role string to Box<[Box<str>]> must go through here.