root/include/crm/common/acl_internal.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. pcmk__is_privileged

   1 /*
   2  * Copyright 2015-2024 the Pacemaker project contributors
   3  *
   4  * The version control history for this file may have further details.
   5  *
   6  * This source code is licensed under the GNU Lesser General Public License
   7  * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
   8  */
   9 
  10 #ifndef PCMK__CRM_COMMON_ACL_INTERNAL__H
  11 #define PCMK__CRM_COMMON_ACL_INTERNAL__H
  12 
  13 #include <string.h>         // strcmp()
  14 #include <libxml/tree.h>    // xmlNode
  15 
  16 #include <crm/common/xml_internal.h>    // enum xml_private_flags
  17 
  18 #ifdef __cplusplus
  19 extern "C" {
  20 #endif
  21 
  22 /* internal ACL-related utilities */
  23 
  24 char *pcmk__uid2username(uid_t uid);
  25 const char *pcmk__update_acl_user(xmlNode *request, const char *field,
  26                                   const char *peer_user);
  27 
  28 static inline bool
  29 pcmk__is_privileged(const char *user)
     /* [previous][next][first][last][top][bottom][index][help] */
  30 {
  31     return user && (!strcmp(user, CRM_DAEMON_USER) || !strcmp(user, "root"));
  32 }
  33 
  34 void pcmk__enable_acl(xmlNode *acl_source, xmlNode *target, const char *user);
  35 
  36 bool pcmk__check_acl(xmlNode *xml, const char *name,
  37                      enum xml_private_flags mode);
  38 
  39 #ifdef __cplusplus
  40 }
  41 #endif
  42 
  43 #endif // PCMK__CRM_COMMON_INTERNAL__H

/* [previous][next][first][last][top][bottom][index][help] */