diff options
Diffstat (limited to 'bin/api')
| -rwxr-xr-x | bin/api | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -67,11 +67,14 @@ end class Organization < Entity class << self def default - @default ||= create!(id: SecureRandom.uuid) + @default ||= all.find { |organization| organization[:name] == "default" } end end end +class Group < Entity +end + class Project < Entity end @@ -134,6 +137,8 @@ class API case request.path when "/organizations", "/organizations.json" return json_ok(Organization.all.map(&:to_h)) + when "/groups", "/groups.json" + return json_ok(Group.all.map(&:to_h)) when "/projects", "/projects.json" resource = Organization.default if authorized?(request, :read_project, resource) |
