@visns-studio/visns-components 3.2.1 → 3.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -193,10 +193,21 @@ function Navigation({
|
|
|
193
193
|
);
|
|
194
194
|
};
|
|
195
195
|
|
|
196
|
+
const getFirstRolePermissions = () => {
|
|
197
|
+
if (
|
|
198
|
+
userProfile.roles &&
|
|
199
|
+
userProfile.roles.length > 0 &&
|
|
200
|
+
userProfile.roles[0].permissions.length > 0
|
|
201
|
+
) {
|
|
202
|
+
return userProfile.roles[0].permissions.map(
|
|
203
|
+
(permission) => permission.name
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
return [];
|
|
207
|
+
};
|
|
208
|
+
|
|
196
209
|
useEffect(() => {
|
|
197
|
-
const permissions =
|
|
198
|
-
(permission) => permission.name
|
|
199
|
-
);
|
|
210
|
+
const permissions = getFirstRolePermissions();
|
|
200
211
|
|
|
201
212
|
setNavData((prevNavData) => {
|
|
202
213
|
const updatePermissions = (nav) => {
|
package/package.json
CHANGED