Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to configure base ModuleRole for Organizations #119

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions buf/registry/owner/v1/organization.proto
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ message Organization {
(buf.validate.field).required = true,
(buf.validate.field).enum.defined_only = true
];
// The base role that Organization members have for repositories in the Organization.
ModuleRole module_base_role = 8 [
(buf.validate.field).required = true,
(buf.validate.field).enum.defined_only = true,
(buf.validate.field).enum.not_in = 5
];
}

// The verification status of an Organization.
Expand All @@ -72,6 +78,21 @@ enum OrganizationVerificationStatus {
ORGANIZATION_VERIFICATION_STATUS_OFFICIAL = 3;
}

// An access role to a module.
enum ModuleRole {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this type belong in buf.registry.module instead of buf.registry.organization?

MODULE_ROLE_UNSPECIFIED = 0;
// A role that has read access to the module.
MODULE_ROLE_READ = 1;
// A role that has limited write access to the module.
MODULE_ROLE_LIMITED_WRITE = 2;
// A role that has full write access to the module.
MODULE_ROLE_WRITE = 3;
// A role that has administrative access to the module.
MODULE_ROLE_ADMIN = 4;
// A role that has owner access to the module.
MODULE_ROLE_OWNER = 5;
}

// OrganizationRef is a reference to an Organization, either an id or a name.
//
// This is used in requests.
Expand Down
7 changes: 7 additions & 0 deletions buf/registry/owner/v1/organization_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,13 @@ message UpdateOrganizationsRequest {
];
// The verification status of the Organization.
optional OrganizationVerificationStatus verification_status = 4 [(buf.validate.field).enum.defined_only = true];

// The base role that Organization members have for repositories in the Organization.
optional ModuleRole module_base_role = 8 [
(buf.validate.field).enum.defined_only = true,
(buf.validate.field).enum.not_in = 0,
(buf.validate.field).enum.not_in = 5
];
}
// The Organizations to update.
repeated Value values = 1 [
Expand Down