]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
netcmd: models: add AccountType IntFlag field
authorRob van der Linde <rob@catalyst.net.nz>
Thu, 1 Feb 2024 03:53:17 +0000 (16:53 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 8 Feb 2024 02:48:44 +0000 (02:48 +0000)
Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/netcmd/domain/models/__init__.py
python/samba/netcmd/domain/models/types.py [new file with mode: 0644]

index b25b6348817d0e92363b2c201638069a7466a4f2..332d3cb907c8d4d5f4bdccc2e12770cbbeede275 100644 (file)
@@ -29,5 +29,6 @@ from .model import MODELS
 from .schema import AttributeSchema, ClassSchema
 from .site import Site
 from .subnet import Subnet
+from .types import AccountType
 from .user import User
 from .value_type import ValueType
diff --git a/python/samba/netcmd/domain/models/types.py b/python/samba/netcmd/domain/models/types.py
new file mode 100644 (file)
index 0000000..83af932
--- /dev/null
@@ -0,0 +1,41 @@
+# Unix SMB/CIFS implementation.
+#
+# Enums and flag types for models.
+#
+# Copyright (C) Catalyst.Net Ltd. 2023
+#
+# Written by Rob van der Linde <rob@catalyst.net.nz>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+
+from enum import IntFlag
+
+from samba.dsdb import (ATYPE_SECURITY_GLOBAL_GROUP,
+                        ATYPE_SECURITY_LOCAL_GROUP,
+                        ATYPE_NORMAL_ACCOUNT,
+                        ATYPE_DISTRIBUTION_GLOBAL_GROUP,
+                        ATYPE_DISTRIBUTION_LOCAL_GROUP,
+                        ATYPE_WORKSTATION_TRUST,
+                        ATYPE_INTERDOMAIN_TRUST)
+
+
+class AccountType(IntFlag):
+    SECURITY_GLOBAL_GROUP = ATYPE_SECURITY_GLOBAL_GROUP
+    SECURITY_LOCAL_GROUP = ATYPE_SECURITY_LOCAL_GROUP
+    NORMAL_ACCOUNT = ATYPE_NORMAL_ACCOUNT
+    DISTRIBUTION_GLOBAL_GROUP = ATYPE_DISTRIBUTION_GLOBAL_GROUP
+    DISTRIBUTION_LOCAL_GROUP = ATYPE_DISTRIBUTION_LOCAL_GROUP
+    WORKSTATION_TRUST = ATYPE_WORKSTATION_TRUST
+    INTERDOMAIN_TRUST = ATYPE_INTERDOMAIN_TRUST