aa_policy_view_capable(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… aa_policy_view_capable(9)

okay so bestie, welcome to the aa_policy_view_capable(9) page β€” it lives in the Kernel API Manual and it's genuinely such a lil cutie. one tiny function, one big question: are you allowed to look at this policy or not? that's it. that's the whole vibe. ✨


πŸŽ€ NAME πŸŽ€

aa_policy_view_capable β€” check if viewing policy in at @ns is allowed πŸ‘€

like, permission check but make it AppArmor. no cap.


✨ SYNOPSIS ✨

bool aa_policy_view_capable (const struct cred *subj_cred , struct
aa_label *label , struct aa_ns *ns );

that's the whole signature, copy it exactly, do not freestyle it 🫢


🌸 ARGUMENTS 🌸

  • subj_cred β€” cred of subject. this is the "who's asking" of it all πŸ’β€β™€οΈ
  • label β€” label that is trying to view policy in ns. main character energy fr fr πŸ‘‘
  • ns β€” namespace being viewed by label (may be NULL if label's ns). yes, NULL is allowed here, breathe 😌

πŸ¦‹ RETURN πŸ¦‹

returns true if viewing policy is allowed. that's it. true or nothing, periodt. πŸ’…

ngl it's a bool, so it's giving simple. no error codes, no drama, just yes/no.

πŸ’– DESCRIPTION πŸ’–

if ns is NULL then the namespace being viewed is assumed to be the task's current namespace. so like, if you don't specify a namespace, it just assumes you mean the one you're already standing in. very "you're already home bestie" of it 🏠✨

that's literally the entire description. short and iconic.


πŸ”₯ SEE ALSO πŸ”₯

kernel file ./security/apparmor/policy.c, and okay bestie, brace yourself, this list is LONG but we do not skip, we never skip πŸ“‹πŸ’€

aa_pdb_free_kref(9), __add_profile(9), __list_remove_profile(9), __remove_profile(9), __aa_profile_list_release(9), aa_free_data(9), aa_free_profile(9), aa_alloc_profile(9), __strn_find_child(9), __find_child(9), aa_find_child(9), __lookup_parent(9), __create_missing_ancestors(9), __lookupn_profile(9), aa_lookupn_profile(9), __aa_new_learning_profile(9), replacement_allowed(9), audit_policy(9), aa_may_manage_policy(9), __replace_profile(9), __lookup_replace(9), aa_replace_profiles(9), aa_remove_profiles(9)

go read them all, i'll wait πŸ“


okay that's the whole page!! mwah πŸ’‹ it's from ./security/apparmor, dated October 2026, and the title is aa_policy_view_capable(9) β€” go forth and check some permissions, bestie 🌈⭐

πŸ“¦ where this page comes from