cap_permission 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "cap_permission"
8
- s.version = "0.0.1"
8
+ s.version = "0.0.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Dru Ibarra"]
@@ -1,16 +1,20 @@
1
1
  Capistrano::Configuration.instance(true).load do
2
- set :group_name, nil
3
- #set :admin_groups, ["sysadmins", "confmgmt"]
2
+ set :admin_groups, ["root", "sysadmins", "confmgmt"]
4
3
 
5
4
  def user_in_group?(group)
6
5
  return false if group.nil?
6
+ puts group
7
7
  user = ENV["SUDO_USER"]
8
8
  groups = capture("groups #{user}")
9
9
  groups.include?(" #{group} ")
10
10
  end
11
11
 
12
12
  def admin_user?()
13
- user_in_group?("sysadmins") or user_in_group?("confmgmt")
13
+ puts admin_groups
14
+ admin_groups.each do |admin_group|
15
+ return true if user_in_group?(admin_group)
16
+ end
17
+ return false
14
18
  end
15
19
 
16
20
  namespace :permission do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cap_permission
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Dru Ibarra