@@ -4,7 +4,6 @@ pragma solidity ^0.8.21;
44import {IRBACGroupable} from "../../interfaces/access/extensions/IRBACGroupable.sol " ;
55
66import {DynamicSet} from "../../libs/data-structures/DynamicSet.sol " ;
7- import {SetHelper} from "../../libs/arrays/SetHelper.sol " ;
87
98import {ARBAC} from "../ARBAC.sol " ;
109
@@ -24,7 +23,6 @@ import {ARBAC} from "../ARBAC.sol";
2423 */
2524abstract contract ARBACGroupable is IRBACGroupable , ARBAC {
2625 using DynamicSet for DynamicSet.StringSet;
27- using SetHelper for DynamicSet.StringSet;
2826
2927 struct ARBACGroupableStorage {
3028 uint256 defaultGroupEnabled;
@@ -211,7 +209,9 @@ abstract contract ARBACGroupable is IRBACGroupable, ARBAC {
211209 function _addUserToGroups (address who_ , string [] memory groupsToAddTo_ ) internal {
212210 ARBACGroupableStorage storage $ = _getARBACGroupableStorage ();
213211
214- $.userGroups[who_].add (groupsToAddTo_);
212+ for (uint256 i = 0 ; i < groupsToAddTo_.length ; ++ i) {
213+ $.userGroups[who_].add (groupsToAddTo_[i]);
214+ }
215215
216216 emit AddedToGroups (who_, groupsToAddTo_);
217217 }
@@ -224,7 +224,9 @@ abstract contract ARBACGroupable is IRBACGroupable, ARBAC {
224224 function _removeUserFromGroups (address who_ , string [] memory groupsToRemoveFrom_ ) internal {
225225 ARBACGroupableStorage storage $ = _getARBACGroupableStorage ();
226226
227- $.userGroups[who_].remove (groupsToRemoveFrom_);
227+ for (uint256 i = 0 ; i < groupsToRemoveFrom_.length ; ++ i) {
228+ $.userGroups[who_].remove (groupsToRemoveFrom_[i]);
229+ }
228230
229231 emit RemovedFromGroups (who_, groupsToRemoveFrom_);
230232 }
@@ -237,7 +239,9 @@ abstract contract ARBACGroupable is IRBACGroupable, ARBAC {
237239 function _grantGroupRoles (string memory groupTo_ , string [] memory rolesToGrant_ ) internal {
238240 ARBACGroupableStorage storage $ = _getARBACGroupableStorage ();
239241
240- $.groupRoles[groupTo_].add (rolesToGrant_);
242+ for (uint256 i = 0 ; i < rolesToGrant_.length ; ++ i) {
243+ $.groupRoles[groupTo_].add (rolesToGrant_[i]);
244+ }
241245
242246 emit GrantedGroupRoles (groupTo_, rolesToGrant_);
243247 }
@@ -250,7 +254,9 @@ abstract contract ARBACGroupable is IRBACGroupable, ARBAC {
250254 function _revokeGroupRoles (string memory groupFrom_ , string [] memory rolesToRevoke_ ) internal {
251255 ARBACGroupableStorage storage $ = _getARBACGroupableStorage ();
252256
253- $.groupRoles[groupFrom_].remove (rolesToRevoke_);
257+ for (uint256 i = 0 ; i < rolesToRevoke_.length ; ++ i) {
258+ $.groupRoles[groupFrom_].remove (rolesToRevoke_[i]);
259+ }
254260
255261 emit RevokedGroupRoles (groupFrom_, rolesToRevoke_);
256262 }
0 commit comments