Code Editor
Congratulations! You built a authorization system from scratch.
def admin?
and def editor?
is created for business logicrequire_editor
and require_admin
methods redirect to () if the current user is not an editor or admin. require_editor
or require_admin
before excuting controller actions. current_user
method can be used in the views to display links based on the signed in user's role.