Commit 66a35075 authored by Roman Lacko's avatar Roman Lacko
Browse files

change project visibility values for new API

parent dcbaf0e9
...@@ -7,6 +7,8 @@ use Log::Any qw($log); ...@@ -7,6 +7,8 @@ use Log::Any qw($log);
use Carp; use Carp;
use GitLab::API; use GitLab::API;
use GitLab::CustomAttributes;
use GitLab::Events;
use GitLab::Groups; use GitLab::Groups;
use GitLab::Members; use GitLab::Members;
use GitLab::Namespaces; use GitLab::Namespaces;
...@@ -43,10 +45,14 @@ use constant { ...@@ -43,10 +45,14 @@ use constant {
MEMBER_MASTER => 40, MEMBER_MASTER => 40,
MEMBER_OWNER => 50, MEMBER_OWNER => 50,
# Project visibility # Project visibility (old values)
PROJECT_PRIVATE => 0, _PROJECT_PRIVATE => 0,
PROJECT_INTERNAL => 10, _PROJECT_INTERNAL => 10,
PROJECT_PUBLIC => 20, _PROJECT_PUBLIC => 20,
PROJECT_PRIVATE => "private",
PROJECT_INTERNAL => "internal",
PROJECT_PUBLIC => "public",
}; };
use constant GROUP_VISIBILITY use constant GROUP_VISIBILITY
...@@ -84,12 +90,23 @@ sub member_access_name { ...@@ -84,12 +90,23 @@ sub member_access_name {
return $member_access_map{$code} // "Invalid"; return $member_access_map{$code} // "Invalid";
} }
my %project_visibility_map = ( my %_project_visibility_map = (
"0" => "Private", "0" => "Private",
"10" => "Internal", "10" => "Internal",
"20" => "Public", "20" => "Public",
); );
sub _project_visibility_name {
my ($code) = @_;
return $_project_visibility_map{$code} // "Invalid";
}
my %project_visibility_map = (
"private" => "Private",
"internal" => "Internal",
"public" => "Public",
);
sub project_visibility_name { sub project_visibility_name {
my ($code) = @_; my ($code) = @_;
return $project_visibility_map{$code} // "Invalid"; return $project_visibility_map{$code} // "Invalid";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment