Module: Geet::Shared::RepoPermissions

Included in:
Github::User, Geet::Services::CreateIssue, Geet::Services::CreatePr
Defined in:
lib/geet/shared/repo_permissions.rb

Constant Summary collapse

PERMISSION_ADMIN =
'admin'
PERMISSION_WRITE =
'write'
PERMISSION_READ =
'read'
PERMISSION_NONE =
'none'
ALL_PERMISSIONS =
[
  PERMISSION_ADMIN,
  PERMISSION_WRITE,
  PERMISSION_READ,
  PERMISSION_NONE,
]

Instance Method Summary collapse

Instance Method Details

#permission_greater_or_equal_to?(subject_permission, object_permission) ⇒ Boolean

Not worth creating a Permission class at this stage.

Returns:

  • (Boolean)


20
21
22
# File 'lib/geet/shared/repo_permissions.rb', line 20

def permission_greater_or_equal_to?(subject_permission, object_permission)
  ALL_PERMISSIONS.index(subject_permission) <= ALL_PERMISSIONS.index(object_permission)
end