MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / detail

Method detail

src/sql/src/rbac.rs:163–192  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

161
162impl UnauthorizedError {
163 pub fn detail(&self) -> Option<String> {
164 match &self {
165 UnauthorizedError::Superuser { action } => {
166 Some(format!("You must be a superuser to {}", action))
167 }
168 UnauthorizedError::Privilege {
169 object_description,
170 role_name,
171 privileges,
172 } => Some(format!(
173 "The '{role_name}' role needs {privileges} privileges on {object_description}"
174 )),
175 UnauthorizedError::MzSystem { .. } => {
176 Some(format!("You must be the '{}' role", SYSTEM_USER.name))
177 }
178 UnauthorizedError::MzSupport { .. } => Some(format!(
179 "The '{}' role has very limited privileges",
180 SUPPORT_USER.name
181 )),
182 UnauthorizedError::ConcurrentRoleDrop(_) => {
183 Some("Please disconnect and re-connect with a valid role.".into())
184 }
185 UnauthorizedError::RestrictedSystemObject { .. } => Some(
186 "Access to system catalog objects is restricted for this role. \
187 Contact your administrator if you need access."
188 .into(),
189 ),
190 UnauthorizedError::Ownership { .. } | UnauthorizedError::RoleMembership { .. } => None,
191 }
192 }
193}
194
195/// RBAC requirements for executing a given plan.

Callers 4

useLicenseKeyFunction · 0.45
queries.tsFile · 0.45
try_run_fail_sqlFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected