File tree 2 files changed +19
-0
lines changed
Controllers/ApiControllers
2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ public IQueryable<user> Getuser()
33
33
}
34
34
35
35
// GET: api/users/5
36
+ //[Authorize(Roles = "Admin")]
36
37
[ ResponseType ( typeof ( user ) ) ]
37
38
public async Task < IHttpActionResult > Getuser ( int id )
38
39
{
Original file line number Diff line number Diff line change @@ -54,6 +54,24 @@ public override async Task GrantResourceOwnerCredentials(OAuthGrantResourceOwner
54
54
//identity.AddClaim(new Claim(ClaimTypes.NameIdentifier, user.userId.ToString()));
55
55
identity . AddClaim ( new Claim ( "UserId" , user . userId . ToString ( ) ) ) ;
56
56
57
+ /*
58
+ if (user.member != null)
59
+ {
60
+ identity.AddClaim(new Claim(ClaimTypes.Role, "Member"));
61
+ }
62
+ if (user.contributor != null)
63
+ {
64
+ identity.AddClaim(new Claim(ClaimTypes.Role, "Contributor"));
65
+ }
66
+ if (user.manager != null)
67
+ {
68
+ identity.AddClaim(new Claim(ClaimTypes.Role, "Manager"));
69
+ }
70
+ if (user.admin != null)
71
+ {
72
+ identity.AddClaim(new Claim(ClaimTypes.Role, "Admin"));
73
+ } */
74
+
57
75
if ( user . member != null )
58
76
{
59
77
identity . AddClaim ( new Claim ( ClaimTypes . Role , "Member" ) ) ;
You can’t perform that action at this time.
0 commit comments