make requestinvite controller method explicit
This commit is contained in:
parent
c1acaba941
commit
9699b41159
2 changed files with 15 additions and 1 deletions
|
@ -1,11 +1,11 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
class MainController < ApplicationController
|
class MainController < ApplicationController
|
||||||
|
before_action :authorize_main
|
||||||
after_action :verify_authorized
|
after_action :verify_authorized
|
||||||
after_action :verify_policy_scoped, only: [:home]
|
after_action :verify_policy_scoped, only: [:home]
|
||||||
|
|
||||||
# GET /
|
# GET /
|
||||||
def home
|
def home
|
||||||
authorize :Main
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html do
|
format.html do
|
||||||
if !authenticated?
|
if !authenticated?
|
||||||
|
@ -17,4 +17,14 @@ class MainController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# GET /request
|
||||||
|
def requestinvite
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def authorize_main
|
||||||
|
authorize :Main
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,4 +3,8 @@ class MainPolicy < ApplicationPolicy
|
||||||
def home?
|
def home?
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def requestinvite?
|
||||||
|
true
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue