简体   繁体   中英

how can i acces to my session of type System.Collections.Generic.List`1 [mySolution.Models.PermissionsModel] and do some tests

how can i acces to my session of type System.Collections.Generic.List`1 [mySolution.Models.Permis... 1 minute ago|LINK|185.125.227.45

I have a web service which returns a list of objects to me. indeed it is a list of permissions according to the logged in user which includes the modules of my application with the permissions (Visible / read / create / delete / modify)

I used this service, I got the list well and I saved it in a session at the time of Login.

To apply these permissions, I would like to access my session and know in the permissions list if the user has the right to do for example a delete or create action ..etc

How I can access my session knowing of type System.Collections.Generic.List`1 [mySolution.Models.PermissionsModel]

i develop in c #, asp.net mvc

Could you please help me on this!

Fetching an item from Session

List<Models.PermissionsModel> permissions = (List<Models.PermissionsModel>)Session["mySessionKey"];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM