From: Rob van der Linde Date: Tue, 21 Nov 2023 03:00:18 +0000 (+1300) Subject: netcmd: models: add a Group model X-Git-Tag: talloc-2.4.2~571 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=96aaa0059f0c7ed310edb9ebd3c6e81c361f8234;p=thirdparty%2Fsamba.git netcmd: models: add a Group model Signed-off-by: Rob van der Linde Reviewed-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/netcmd/domain/models/__init__.py b/python/samba/netcmd/domain/models/__init__.py index 165f03fe802..8a6b254c70a 100644 --- a/python/samba/netcmd/domain/models/__init__.py +++ b/python/samba/netcmd/domain/models/__init__.py @@ -23,6 +23,7 @@ from .auth_policy import AuthenticationPolicy from .auth_silo import AuthenticationSilo from .claim_type import ClaimType +from .group import Group from .model import MODELS from .schema import AttributeSchema, ClassSchema from .site import Site diff --git a/python/samba/netcmd/domain/models/group.py b/python/samba/netcmd/domain/models/group.py new file mode 100644 index 00000000000..947312783c0 --- /dev/null +++ b/python/samba/netcmd/domain/models/group.py @@ -0,0 +1,42 @@ +# Unix SMB/CIFS implementation. +# +# Group model. +# +# Copyright (C) Catalyst.Net Ltd. 2023 +# +# Written by Rob van der Linde +# +# 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 . +# + +from .fields import BooleanField, DnField, IntegerField, SIDField, StringField +from .model import Model + + +class Group(Model): + admin_count = IntegerField("adminCount") + description = StringField("description") + is_critical_system_object = BooleanField("isCriticalSystemObject", + default=False, readonly=True) + member = DnField("member", many=True) + object_sid = SIDField("objectSid") + system_flags = IntegerField("systemFlags") + + @staticmethod + def get_object_class(): + return "group" + + def get_authentication_sddl(self): + return "O:SYG:SYD:(XA;OICI;CR;;;WD;(Member_of_any {SID(%s)}))" % ( + self.object_sid)