Skip to content

A free open source IT asset/license management system

Added the actual files to make that previous statement true

Brady Wetheringtonfc4ac029b137
diff --git a/app/Models/Group.php b/app/Models/Group.php
index 9f4f2e2e56..b0991f4a9a 100755
--- a/app/Models/Group.php
+++ b/app/Models/Group.php
@@ -59,6 +59,12 @@ class Group extends SnipeModel
return $this->belongsToMany(\App\Models\User::class, 'users_groups');
}
+ /* this is just a shim for SCIM to work */
+ public function members()
+ {
+ return $this->users();
+ }
+
/**
* Get the user that created the group
*
diff --git a/app/Models/SCIMUser.php b/app/Models/SCIMUser.php
index f261fea8b6..87b023dc58 100644
--- a/app/Models/SCIMUser.php
+++ b/app/Models/SCIMUser.php
@@ -13,4 +13,11 @@ class SCIMUser extends User
$attributes['password'] = $this->noPassword();
parent::__construct($attributes);
}
+
+ // Have to re-define this here because Eloquent will try to 'guess' a foreign key of s_c_i_m_user_id
+ // from SCIMUser
+ public function groups()
+ {
+ return $this->belongsToMany(\App\Models\Group::class, 'users_groups', 'user_id', 'group_id');
+ }
}
\ No newline at end of file
diff --git a/app/Models/SnipeSCIMConfig.php b/app/Models/SnipeSCIMConfig.php
index 4aa462a82e..a78bd6632c 100644
--- a/app/Models/SnipeSCIMConfig.php
+++ b/app/Models/SnipeSCIMConfig.php
@@ -438,6 +438,7 @@ class SnipeSCIMConfig
}
}
),
+ eloquent('externalId', 'scim_externalid'),
new Meta('Groups'),
(new AttributeSchema(Schema::SCHEMA_GROUP, true))->withSubAttributes(
eloquent('displayName', 'name')->ensure('required', 'min:3', function ($attribute, $value, $fail) {