This is a collection of simple functions that I kept having to re-write on a fairly regular basis. They are published on the offchance that they are useful.
Patches Welcome
If available in Hex, the package can be installed
by adding ad_utils
to your list of dependencies in mix.exs
:
def deps do
[
{:ad_utils, "~> 0.1.0"}
]
end
- AD.Utils.UserAccessControl.resolve(integer) - Converts the value from userAccountControl into an array of atoms that represent the flags that have been set.
iex(1)> AD.Utils.UserAccessControl.resolve(514)
[:ACCOUNTDISABLE, :NORMAL_ACCOUNT]
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/ad_utils.