Verified Commit f601c45d authored by Roman Lacko's avatar Roman Lacko
Browse files

GitLab: Reformat constants

parent b7ff3203
...@@ -25,15 +25,40 @@ use GitLab::Users; ...@@ -25,15 +25,40 @@ use GitLab::Users;
use parent "Exporter"; use parent "Exporter";
our @EXPORT_OK = (); our %EXPORT_TAGS = (
our %EXPORT_TAGS = ( group_visibility => [qw(
group_visibility => [ qw|GROUP_VISIBILITY GROUP_PRIVATE GROUP_INTERNAL GROUP_PUBLIC | ], GROUP_VISIBILITY
member_access => [ qw|MEMBER_ACCESS MEMBER_GUEST MEMBER_REPORTER MEMBER_DEVELOPER MEMBER_MASTER MEMBER_OWNER | ], GROUP_PRIVATE
project_visibility => [ qw|PROJECT_PRIVATE PROJECT_INTERNAL PROJECT_PUBLIC| ], GROUP_INTERNAL
utils => [ qw|group_visibility_name member_access_name| ], GROUP_PUBLIC
)],
member_access => [qw(
MEMBER_ACCESS
MEMBER_GUEST
MEMBER_REPORTER
MEMBER_DEVELOPER
MEMBER_MASTER
MEMBER_OWNER
)],
project_visibility => [qw(
PROJECT_PRIVATE
PROJECT_INTERNAL
PROJECT_PUBLIC
)],
utils => [qw(
group_visibility_name
member_access_name
)],
); );
Exporter::export_ok_tags(qw|group_visibility member_access project_visibility utils|); Exporter::export_ok_tags(qw(
group_visibility
member_access
project_visibility utils
));
#=============================================================================== #===============================================================================
# Constants # Constants
...@@ -41,29 +66,42 @@ Exporter::export_ok_tags(qw|group_visibility member_access project_visibility ut ...@@ -41,29 +66,42 @@ Exporter::export_ok_tags(qw|group_visibility member_access project_visibility ut
use constant { use constant {
# Group Visibility # Group Visibility
GROUP_PRIVATE => "private", GROUP_PRIVATE => "private",
GROUP_INTERNAL => "internal", GROUP_INTERNAL => "internal",
GROUP_PUBLIC => "public", GROUP_PUBLIC => "public",
# Member rights # Member rights
MEMBER_GUEST => 10, MEMBER_GUEST => 10,
MEMBER_REPORTER => 20, MEMBER_REPORTER => 20,
MEMBER_DEVELOPER => 30, MEMBER_DEVELOPER => 30,
MEMBER_MASTER => 40, MEMBER_MASTER => 40,
MEMBER_OWNER => 50, MEMBER_OWNER => 50,
# Project Visibility # Project Visibility
PROJECT_PRIVATE => "private", PROJECT_PRIVATE => "private",
PROJECT_INTERNAL => "internal", PROJECT_INTERNAL => "internal",
PROJECT_PUBLIC => "public", PROJECT_PUBLIC => "public",
}; };
use constant GROUP_VISIBILITY use constant GROUP_VISIBILITY => (
=> (GROUP_PRIVATE, GROUP_INTERNAL, GROUP_PUBLIC); GROUP_PRIVATE,
use constant MEMBER_ACCESS GROUP_INTERNAL,
=> (MEMBER_GUEST, MEMBER_REPORTER, MEMBER_DEVELOPER, MEMBER_MASTER, MEMBER_OWNER); GROUP_PUBLIC,
use constant PROJECT_VISIBILITY );
=> (PROJECT_PRIVATE, PROJECT_INTERNAL, PROJECT_PUBLIC);
use constant MEMBER_ACCESS => (
MEMBER_GUEST,
MEMBER_REPORTER,
MEMBER_DEVELOPER,
MEMBER_MASTER,
MEMBER_OWNER,
);
use constant PROJECT_VISIBILITY => (
PROJECT_PRIVATE,
PROJECT_INTERNAL,
PROJECT_PUBLIC,
);
#=============================================================================== #===============================================================================
# Utilities # Utilities
...@@ -105,9 +143,9 @@ sub _project_visibility_name { ...@@ -105,9 +143,9 @@ sub _project_visibility_name {
} }
my %project_visibility_map = ( my %project_visibility_map = (
"private" => "Private", "private" => "Private",
"internal" => "Internal", "internal" => "Internal",
"public" => "Public", "public" => "Public",
); );
sub project_visibility_name { sub project_visibility_name {
......
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