Last change
on this file since 11020 was
11020,
checked in by mroscoe, 10 years ago
|
First check-in for Matt Roscoe. Major revision, multiple new files created and multiple files changed.
|
File size:
773 bytes
|
Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Web;
|
---|
5 | using System.Web.Mvc;
|
---|
6 | using HeuristicLab.Services.Hive.Statistics.Models;
|
---|
7 |
|
---|
8 | namespace HeuristicLab.Services.Hive.Statistics.Controllers {
|
---|
9 | public class LoginRequiredController : Controller {
|
---|
10 |
|
---|
11 | [Authorize]
|
---|
12 | public ActionResult UserTask() {
|
---|
13 | var result = new UserModel {
|
---|
14 | UserName = User.Identity.Name
|
---|
15 | };
|
---|
16 | return View(result);
|
---|
17 | }
|
---|
18 |
|
---|
19 | [Authorize]
|
---|
20 | public ActionResult Admin() {
|
---|
21 | var result = new AdminModel {
|
---|
22 | IsAdmin = false,
|
---|
23 | UserName = User.Identity.Name
|
---|
24 | };
|
---|
25 | if (User.IsInRole("Hive Administrator")) {
|
---|
26 | result.IsAdmin = true;
|
---|
27 | }
|
---|
28 |
|
---|
29 | return View(result);
|
---|
30 | }
|
---|
31 | }
|
---|
32 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.