lib/gitauth/user.rb in brownbeagle-gitauth-0.0.4.0 vs lib/gitauth/user.rb in brownbeagle-gitauth-0.0.4.1
- old
+ new
@@ -86,10 +86,14 @@
self.class.save!
GitAuth::Repo.save!
GitAuth::Group.save!
end
+ def groups
+ (Group.all || []).select { |g| g.member?(self) }
+ end
+
def admin?
!!@admin
end
alias shell_accessible? admin?
@@ -117,9 +121,13 @@
if key =~ /^(ssh-\w+ [a-zA-Z0-9\/\+]+==?).*$/
return $1
else
return nil
end
+ end
+
+ def self.valid_key?(key)
+ clean_ssh_key(key).present?
end
end
Users = User # For Backwards Compat.
end
\ No newline at end of file