abp.auth
is initialized in ~/lib/abp-web-resources/Abp/Framework/scripts/abp.js.
That's included in _Layout.cshtml
by default:
<environment names="Development">
<script src="~/lib/abp-web-resources/Abp/Framework/scripts/abp.js" asp-append-version="true"></script>
</environment>
<environment names="Staging,Production">
<script src="~/view-resources/Views/_Bundles/shared-layout.min.js" asp-append-version="true"></script>
</environment>
Since it's a JavaScript library and not a .dll, it can be updated in package.json using yarn/npm.
abp = abp || {}. So where does the abp at the right come from?
It doesn't necessarily come from anywhere. It's done like this so that you can define abp
and add your properties to the object even before abp.js loads, and this avoids replacing it.
Where does abp.auth get its value then?
abp.auth
is just a JavaScript object. If you mean the allPermissions
property, see #2569.
It's populated in AuthorizationScriptManager
.
how to debug this library?
To enable debugging, change Visual Studio (2017+) Debugging options like in the docs:
- Uncheck "Enable Just My Code"
- Check "Enable source server support"
- Check "Enable source link support"