Skip to content

Commit 4bd8912

Browse files
committed
fixed admin viewing bug
1 parent b4e9a23 commit 4bd8912

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/controllers/plans_controller.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ def index
1515
# GET /plans/1
1616
# GET /plans/1.json
1717
def show
18-
if @plan.user_id != current_user.id
19-
redirect_to plans_path
18+
if current_user.role == "student"
19+
if @plan.user_id != current_user.id
20+
redirect_to plans_path
21+
end
2022
end
2123
end
2224

0 commit comments

Comments
 (0)