Module: Gitlab::Glaz
- Defined in:
- lib/gitlab/glaz.rb,
lib/gitlab/glaz/engine.rb,
lib/gitlab/glaz/version.rb,
lib/gitlab/glaz/govern_policy_engine.rb
Defined Under Namespace
Classes: Engine, GovernPolicyEngine
Constant Summary collapse
- VERSION =
"1.1.0"
Class Method Summary collapse
-
.govern_policy_engine ⇒ Object
Returns the shared Gitlab::Glaz::GovernPolicyEngine instance, memoized across calls.
-
.roles ⇒ Object
Returns the default roles embedded in the native extension at build time, sourced from the glaz-roles crate's roles/**/*.yml definitions.
Class Method Details
.govern_policy_engine ⇒ Object
Returns the shared Gitlab::Glaz::GovernPolicyEngine instance, memoized
across calls. Evaluate Rego governance policies via
govern_policy_engine.evaluate; see GovernPolicyEngine#evaluate for
the full contract.
31 32 33 |
# File 'lib/gitlab/glaz.rb', line 31 def govern_policy_engine @govern_policy_engine ||= GovernPolicyEngine.new end |
.roles ⇒ Object
Returns the default roles embedded in the native extension at build time,
sourced from the glaz-roles crate's roles/**/*.yml definitions. Each entry
is a hash: { id: String, name: String, permissions: Array
20 21 22 23 24 25 |
# File 'lib/gitlab/glaz.rb', line 20 def roles @roles ||= ::Glaz.roles.each do |role| role[:permissions].freeze role.freeze end.freeze end |