Ignore:
Timestamp:
08/22/24 01:46:17 (5 weeks ago)
Author:
ElenaMoskova <elena.moskova99@…>
Branches:
main
Children:
72b1da2
Parents:
d6040ef
Message:

Аsync, access permission, and other fixes.

Regulation of access permissions. Which fields can be accessed by different users.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • PostgreSqlDotnetCore/Controllers/CityController.cs

    rd6040ef r57fc402  
    1717        public async Task<ActionResult> IndexAsync()
    1818         {
     19           // check for permission
     20          UsersClass customerClass = await checkAuthorizationAsync();
     21
     22
     23           if (customerClass == null)
     24             {
     25                 return RedirectToAction("AccessDenied", "Error");
     26             }
     27
     28            var citiess = await db.CitiesObj.ToListAsync();
     29
     30            return View(citiess);
     31        }
     32       
     33
     34
     35
     36        /* public async Task<ActionResult> IndexAsync()
     37         {
    1938             // check for permission
    2039             UsersClass customerClass = await checkAuthorizationAsync();
     
    2645             return View(db.CitiesObj.ToList());
    2746         }
    28        
     47        */
     48
    2949
    3050
     
    138158            base.Dispose(disposing);
    139159        }
     160
     161
     162
     163       
    140164    }
    141165}
Note: See TracChangeset for help on using the changeset viewer.