Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
17ae37f5
Commit
17ae37f5
authored
Feb 06, 2018
by
Oswaldo Ferreira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add developer docs for how to add a licensed feature
parent
8b200096
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
0 deletions
+38
-0
doc/development/README.md
doc/development/README.md
+1
-0
doc/development/licensed_feature_availability.md
doc/development/licensed_feature_availability.md
+37
-0
No files found.
doc/development/README.md
View file @
17ae37f5
...
...
@@ -33,6 +33,7 @@ comments: false
-
[
Sidekiq guidelines
](
sidekiq_style_guide.md
)
for working with Sidekiq workers
-
[
Working with Gitaly
](
gitaly.md
)
-
[
Manage feature flags
](
feature_flags.md
)
-
[
Licensed feature availability
](
licensed_feature_availability.md
)
-
[
View sent emails or preview mailers
](
emails.md
)
-
[
Shell commands
](
shell_commands.md
)
in the GitLab codebase
-
[
`Gemfile` guidelines
](
gemfile.md
)
...
...
doc/development/licensed_feature_availability.md
0 → 100644
View file @
17ae37f5
# Licensed feature availability
As of GitLab 9.4, we've been supporting a simplified version of licensed
feature availability checks via
`lib/license.rb`
, both for
on-premise or GitLab.com plans and features.
## Restricting features scoped by namespaces or projects
GitLab.com plans are persisted on user groups and namespaces, therefore, if you're adding a
feature such as
[
Related issues
](
../user/project/issues/related_issues.md
)
or
[
Service desk
](
../user/project/service_desk.md
)
,
it should be restricted on namespace scope.
1.
Add the feature symbol on
`EES_FEATURES`
,
`EEP_FEATURES`
or
`EEU_FEATURES`
constants in
`lib/license.rb`
. Note on
`ee/app/models/ee/namespace.rb`
that _Bronze_ GitLab.com
features maps to on-premise _EES_, _Silver_ to _EEP_ and _Gold_ to _EEU_.
2.
Check using:
```
ruby
project
.
feature_available?
(
:feature_symbol
)
```
## Restricting global features (instance)
However, for features such as
[
Geo
](
../gitlab-geo/README.md
)
and
[
Load balancing
](
../administration/database_load_balancing.md
)
, which cannot be restricted
to only a subset of projects or namespaces, the check will be made directly in
the instance license.
1.
Add the feature symbol on
`EES_FEATURES`
,
`EEP_FEATURES`
or
`EEU_FEATURES`
constants in
`lib/license.rb`
.
2.
Add the same feature symbol to
`GLOBAL_FEATURES`
3.
Check using:
```
ruby
License
.
feature_available?
(
:feature_symbol
)
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment