windmill_api/models/acl_grant.rs
1/*
2 * Windmill API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.817.0
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct AclGrant {
16 #[serde(rename = "grantee")]
17 pub grantee: String,
18 #[serde(rename = "privileges")]
19 pub privileges: Vec<String>,
20 #[serde(rename = "object", skip_serializing_if = "Option::is_none")]
21 pub object: Option<Box<models::AclObject>>,
22 /// set for a default privilege, naming the kind of object it covers (TABLES, SEQUENCES, FUNCTIONS, TYPES, or SCHEMAS). On a schema, the defaults set in that schema; on the database, the ones set database-wide, which apply in every schema and which no schema's own defaults take back.
23 #[serde(rename = "future", skip_serializing_if = "Option::is_none")]
24 pub future: Option<String>,
25 /// the roles the grant comes from, each once — who granted it, or for a default privilege the role whose future objects it covers. A revoke of some of the grant's privileges takes them back from every source that gave them.
26 #[serde(rename = "sources")]
27 pub sources: Vec<models::AclSource>,
28}
29
30impl AclGrant {
31 pub fn new(grantee: String, privileges: Vec<String>, sources: Vec<models::AclSource>) -> AclGrant {
32 AclGrant {
33 grantee,
34 privileges,
35 object: None,
36 future: None,
37 sources,
38 }
39 }
40}
41