Ignore:
Timestamp:
08/23/24 03:03:32 (5 weeks ago)
Author:
ElenaMoskova <elena.moskova99@…>
Branches:
main
Children:
118e414
Parents:
57fc402
Message:

Providing access

Providing access to various functionalities

Location:
PostgreSqlDotnetCore/Views
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • PostgreSqlDotnetCore/Views/Blog/Edit.cshtml

    r57fc402 r72b1da2  
    4141        </div>
    4242    </div>
    43     <div class="form-group">
     43    @*<div class="form-group">
    4444        @Html.LabelFor(model => model.users_id, htmlAttributes: new { @class = "control-label col-md-2" })
    4545        <div class="col-md-10">
     
    4848        </div>
    4949    </div>
    50 
     50    *@
    5151    <div class="form-group">
    5252        <div class="col-md-offset-2 col-md-10">
  • PostgreSqlDotnetCore/Views/Blog/Index.cshtml

    r57fc402 r72b1da2  
    4545        </th>
    4646
    47         <td>
     47       @*<td>
    4848            @Html.ActionLink("Edit", "Edit", new { id = item.id }) |
    4949            @Html.ActionLink("Answers", "Details", new { id = item.id }) |
    5050            @Html.ActionLink("Delete", "Delete", new { id = item.id })
    5151        </td>
     52        *@
     53           
     54
     55
     56
     57              @if (item.users_id == ViewBag.CurrentUserId)
     58              {
     59              <td>
     60            @Html.ActionLink("Edit", "Edit", new { id = item.id })
     61            @Html.ActionLink("Delete", "Delete", new { id = item.id })
     62             
     63        </td>
     64            }
     65
     66           
     67
     68            @if (item.users_id == ViewBag.CurrentUserId || item.users_id != ViewBag.CurrentUserId)
     69            {
     70                <td>
     71                   
     72                    @Html.ActionLink("Answers", "Details", new { id = item.id })
     73                   
     74
     75                </td>
     76            }
     77           
     78
     79
     80           
     81       
     82           
    5283    </tr>
    5384}
  • PostgreSqlDotnetCore/Views/Products/Index.cshtml

    r57fc402 r72b1da2  
    9898                        <div class="col-md-6 col-xs-6">
    9999                            <h3>@item.name</h3>
    100                             @if (SignInManager.IsSignedIn(User))
     100                            @if (SignInManager.IsSignedIn(User) && ViewBag.hasAccess != null)
     101                            // SignInManager.IsSignedIn(User) && ViewBag.hasAccess != null
     102                            //SignInManager.IsSignedIn(User) && ViewBag.hasAccess != null && ViewBag.hasAccess == true
     103                         
     104                               
    101105                            {
    102106                                <div class="edit-crud-products">
     
    107111                            }
    108112                        </div>
     113                       
     114                       
    109115                        <div class="col-md-6 col-xs-6 price">
    110116                            <h3>
  • PostgreSqlDotnetCore/Views/VetCenter/Index.cshtml

    r57fc402 r72b1da2  
    8585            </td>
    8686
    87             @if (SignInManager.IsSignedIn(User))
     87           
     88
     89         @*   @if ((SignInManager.IsSignedIn(User)))
    8890            {
    8991                <td>
     
    9597                </td>
    9698            }
     99           *@
     100
     101            @* Додадете условие за проверка на улогите *@
     102            @if (SignInManager.IsSignedIn(User) && (ViewBag.hasAccess != null && ViewBag.hasAccess == true))
     103            {
     104                <td>
     105                    @Html.ActionLink("Edit", "Edit", new { id = item.id }) |
     106                    @Html.ActionLink("Details", "Details", new { id = item.id }) |
     107                    @Html.ActionLink("Delete", "Delete", new { id = item.id })
     108                </td>
     109            }
    97110
    98111        </tr>
Note: See TracChangeset for help on using the changeset viewer.