File tree 2 files changed +3
-3
lines changed
Controllers/ApiControllers
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -26,14 +26,14 @@ public usersController()
26
26
}
27
27
28
28
// GET: api/users
29
+
29
30
[ Authorize ( Roles = "Admin" ) ]
30
31
public IQueryable < user > Getuser ( )
31
32
{
32
33
return db . user ;
33
34
}
34
35
35
36
// GET: api/users/5
36
- //[Authorize(Roles = "Admin")]
37
37
[ ResponseType ( typeof ( user ) ) ]
38
38
public async Task < IHttpActionResult > Getuser ( int id )
39
39
{
Original file line number Diff line number Diff line change @@ -51,10 +51,10 @@ public override async Task GrantResourceOwnerCredentials(OAuthGrantResourceOwner
51
51
identity . AddClaim ( new Claim ( "mail" , context . UserName ) ) ;
52
52
identity . AddClaim ( new Claim ( "role" , "user" ) ) ;
53
53
identity . AddClaim ( new Claim ( ClaimTypes . Name , context . UserName ) ) ;
54
+
54
55
//identity.AddClaim(new Claim(ClaimTypes.NameIdentifier, user.userId.ToString()));
55
56
identity . AddClaim ( new Claim ( "UserId" , user . userId . ToString ( ) ) ) ;
56
57
57
- /*
58
58
if ( user . member != null )
59
59
{
60
60
identity . AddClaim ( new Claim ( ClaimTypes . Role , "Member" ) ) ;
@@ -70,7 +70,7 @@ public override async Task GrantResourceOwnerCredentials(OAuthGrantResourceOwner
70
70
if ( user . admin != null )
71
71
{
72
72
identity . AddClaim ( new Claim ( ClaimTypes . Role , "Admin" ) ) ;
73
- } */
73
+ }
74
74
75
75
if ( user . member != null )
76
76
{
You can’t perform that action at this time.
0 commit comments