getting_started_controller.rb 556 B

12345678910111213141516171819202122232425262728
  1. class GettingStartedController < ApplicationController
  2. def index
  3. # check if first user already exists
  4. master_user = 0
  5. count = User.all.count()
  6. if count == 1
  7. master_user = 1
  8. end
  9. # get all groups
  10. @groups = Group.where( :active => true )
  11. @roles = Role.where( :active => true )
  12. # return result
  13. respond_to do |format|
  14. format.json {
  15. render :json => {
  16. :master_user => master_user,
  17. :groups => @groups,
  18. :roles => @roles,
  19. }
  20. }
  21. end
  22. end
  23. end