debian-mirror-gitlab/app/assets/javascripts/pages/projects/shared/permissions/constants.js

45 lines
1.3 KiB
JavaScript
Raw Normal View History

2019-07-31 22:56:46 +05:30
import { __ } from '~/locale';
2018-03-17 18:26:18 +05:30
export const visibilityOptions = {
PRIVATE: 0,
INTERNAL: 10,
PUBLIC: 20,
};
export const visibilityLevelDescriptions = {
2019-07-31 22:56:46 +05:30
[visibilityOptions.PRIVATE]: __(
2018-12-13 13:39:08 +05:30
'The project is accessible only by members of the project. Access must be granted explicitly to each user.',
2019-07-31 22:56:46 +05:30
),
[visibilityOptions.INTERNAL]: __('The project can be accessed by any user who is logged in.'),
[visibilityOptions.PUBLIC]: __(
2018-12-13 13:39:08 +05:30
'The project can be accessed by anyone, regardless of authentication.',
2019-07-31 22:56:46 +05:30
),
2018-03-17 18:26:18 +05:30
};
2019-09-30 21:07:59 +05:30
2019-12-04 20:38:33 +05:30
export const featureAccessLevel = {
2019-09-30 21:07:59 +05:30
NOT_ENABLED: 0,
PROJECT_MEMBERS: 10,
EVERYONE: 20,
};
const featureAccessLevelDescriptions = {
[featureAccessLevel.NOT_ENABLED]: __('Enable feature to choose access level'),
[featureAccessLevel.PROJECT_MEMBERS]: __('Only Project Members'),
[featureAccessLevel.EVERYONE]: __('Everyone With Access'),
};
export const featureAccessLevelNone = [
featureAccessLevel.NOT_ENABLED,
featureAccessLevelDescriptions[featureAccessLevel.NOT_ENABLED],
];
export const featureAccessLevelMembers = [
featureAccessLevel.PROJECT_MEMBERS,
featureAccessLevelDescriptions[featureAccessLevel.PROJECT_MEMBERS],
];
export const featureAccessLevelEveryone = [
featureAccessLevel.EVERYONE,
featureAccessLevelDescriptions[featureAccessLevel.EVERYONE],
];