Open Core Interface - MLPI
MLPI-MotionLogicProgrammingInterface(mlpiCore)  1.26.2
mlpiAccessControlLib.h
Go to the documentation of this file.
1 #ifndef __MLPIACCESSCONTROLLIB_H__
2 #define __MLPIACCESSCONTROLLIB_H__
3 
4 // -----------------------------------------------------------------------
5 // MLPI - <mlpiAccessControlLib.h>
6 // -----------------------------------------------------------------------
7 // Copyright (c) 2016 Bosch Rexroth. All rights reserved.
8 // Redistribution and use in source and binary forms of this MLPI software
9 // (SW) provided to you, with or without modification, are permitted
10 // without prior approval provided that the following conditions are met:
11 //
12 // 1. Redistributions of source code of SW must retain the above copyright
13 // notice, this list of conditions and the following disclaimer.
14 //
15 // 2. Redistributions in binary form of SW must reproduce the above copyright
16 // notice, this list of conditions and the following disclaimer in the
17 // documentation and/or other materials provided with the distribution.
18 //
19 // 3. User recognizes and acknowledges that it acquires no right,
20 // title or interest in or to any of the names or trademarks used in
21 // connection with the SW ("names") by virtue of this License and waives
22 // any right to or interest in the names. User recognizes and acknowledges
23 // that names of companies or names or products of companies displayed
24 // in the documentation of SW to indicate the interoperability of products
25 // with the SW are the names of their respective owners. The use of such
26 // names in the documentation of SW does not imply any sponsorship,
27 // approval, or endorsement by such companies of this product.
28 //
29 // 4. Modified code versions, i.e. any addition to or deletion from
30 // the substance or structure of the original code of the SW running
31 // the MLPI must be plainly marked as such and must not be misrepresented
32 // as being original SW.
33 //
34 // 5. The SW may only be used in connection with a Bosch Rexroth product.
35 //
36 // THIS INFORMATION IS PROVIDED BY BOSCH REXROTH CORPORATION "AS IS"
37 // AND WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED, INCLUDING
38 // (BUT NOTLIMITED TO) ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
39 // FITNESS FOR ANY PARTICULAR PURPOSE, OR NON-INFRINGEMENT. WHILE THE
40 // INFORMATION PROVIDED IS BELIEVED TO BE ACCURATE, IT MAY INCLUDE
41 // ERRORS OR INACCURACIES.
42 // SUBJECT TO COMPULSORY STATUTORY PROVISIONS OF THE GERMAN LAW AS
43 // THE APPLICABLE LAW FOR THIS LICENSE BOSCH REXROTH CORPORATION WILL
44 // NOT BE LIABLE FOR ANY DAMAGES OF ANY KIND ARISING FROM THE USE OF
45 // THE SOFTWARE DISTRIBUTED HEREUNDER, INCLUDING BUT NOT LIMITED TO
46 // DIRECT, INDIRECT, INCIDENTAL, PUNITIVE, AND CONSEQUENTIAL DAMAGES.
47 // -----------------------------------------------------------------------
48 //
58 //
59 // -----------------------------------------------------------------------
60 
80 
199 
202 // -----------------------------------------------------------------------
203 // GLOBAL INCLUDES
204 // -----------------------------------------------------------------------
205 #include "mlpiGlobal.h"
206 
207 // -----------------------------------------------------------------------
208 // GLOBAL CONSTANTS
209 // -----------------------------------------------------------------------
210 
217 
218 // , ; " "
219 
220 #define MLPI_MAX_USERNAME_LEN (32)
221 #define MLPI_MAX_GROUPNAME_LEN (32)
222 #define MLPI_MAX_INVALIDCHARS_LEN (32)
223 #define MLPI_MAX_USER_DESCRIPTION_LEN (128)
224 #define MLPI_MAX_GROUP_DESCRIPTION_LEN (128)
225 #define MLPI_MAX_PERMISSION_LEN (128)
226 
227 //-----------------------------------------------------------------------
228 // GLOBAL ENUMERATIONS
229 //-----------------------------------------------------------------------
230 
234 {
238 
242 {
246 
247 // -----------------------------------------------------------------------
248 // GLOBAL TYPEDEFS
249 // -----------------------------------------------------------------------
250 
251 // message packing follows 8 byte natural alignment
252 #if !defined(TARGET_OS_VXWORKS)
253 #pragma pack(push,8)
254 #endif
255 
267 typedef struct MlpiUserInfo
268 {
270  WCHAR16 MLPI_STRUCT_ALIGN_WCHAR16 username[MLPI_MAX_USERNAME_LEN];
271  WCHAR16 MLPI_STRUCT_ALIGN_WCHAR16 description[MLPI_MAX_USER_DESCRIPTION_LEN];
274 } MlpiUserInfo;
275 
276 
286 
288 {
290  ULONG MLPI_STRUCT_ALIGN_ULONG expirationTime;
293 
308 typedef struct MlpiUserDetails
309 {
311  WCHAR16 MLPI_STRUCT_ALIGN_WCHAR16 username[MLPI_MAX_USERNAME_LEN];
312  WCHAR16 MLPI_STRUCT_ALIGN_WCHAR16 description[MLPI_MAX_USER_DESCRIPTION_LEN];
314  BOOL8 MLPI_STRUCT_ALIGN_BOOL8 userExpirationEnabled;
315  MlpiDateAndTime MLPI_STRUCT_ALIGN_STRUCT userExpirationTime;
319 
332 typedef struct MlpiPasswordPolicies
333 {
334  ULONG MLPI_STRUCT_ALIGN_ULONG minLength;
335  ULONG MLPI_STRUCT_ALIGN_ULONG maxLength;
336  ULONG MLPI_STRUCT_ALIGN_ULONG minUpperCase;
337  ULONG MLPI_STRUCT_ALIGN_ULONG minLowerCase;
338  ULONG MLPI_STRUCT_ALIGN_ULONG minNumerical;
339  ULONG MLPI_STRUCT_ALIGN_ULONG minSpecial;
341 
354 typedef struct MlpiUserPolicies
355 {
356  ULONG MLPI_STRUCT_ALIGN_ULONG usernameMinLength;
357  ULONG MLPI_STRUCT_ALIGN_ULONG usernameMaxLength;
358  WCHAR16 MLPI_STRUCT_ALIGN_WCHAR16 usernameInvalidChars[MLPI_MAX_INVALIDCHARS_LEN];
359  ULONG MLPI_STRUCT_ALIGN_ULONG descriptionMinLength;
360  ULONG MLPI_STRUCT_ALIGN_ULONG descriptionMaxLength;
363 
374 typedef struct MlpiGroupInfo
375 {
377  WCHAR16 MLPI_STRUCT_ALIGN_WCHAR16 groupName[MLPI_MAX_GROUPNAME_LEN];
378  WCHAR16 MLPI_STRUCT_ALIGN_WCHAR16 description[MLPI_MAX_GROUP_DESCRIPTION_LEN];
380 } MlpiGroupInfo;
381 
393 typedef struct MlpiGroupPolicies
394 {
395  ULONG MLPI_STRUCT_ALIGN_ULONG groupNameMinLength;
396  ULONG MLPI_STRUCT_ALIGN_ULONG groupNameMaxLength;
397  WCHAR16 MLPI_STRUCT_ALIGN_WCHAR16 groupNameInvalidChars[MLPI_MAX_INVALIDCHARS_LEN];
398  ULONG MLPI_STRUCT_ALIGN_ULONG descriptionMinLength;
399  ULONG MLPI_STRUCT_ALIGN_ULONG descriptionMaxLength;
401 
412 typedef struct MlpiGroupDetails
413 {
415  WCHAR16 MLPI_STRUCT_ALIGN_WCHAR16 groupName[MLPI_MAX_GROUPNAME_LEN];
416  WCHAR16 MLPI_STRUCT_ALIGN_WCHAR16 description[MLPI_MAX_GROUP_DESCRIPTION_LEN];
419 
420 #if !defined(TARGET_OS_VXWORKS)
421 #pragma pack(pop)
422 #endif
423 
425 // -----------------------------------------------------------------------
426 // GLOBAL EXPORTS
427 // -----------------------------------------------------------------------
428 #ifdef MLPI_API
429 #undef MLPI_API
430 #endif
431 
432 #if defined(TARGET_OS_WINNT)
433 #if defined(MLPI_EXPORTS)
434 #define MLPI_API __declspec(dllexport)
435 #elif defined(MLPI_IMPORTS)
436 #define MLPI_API __declspec(dllimport)
437 #else
438 #define MLPI_API
439 #endif
440 #else
441 #if defined(MLPI_EXPORTS)
442 #define MLPI_API __attribute__ ((visibility("default")))
443 #elif defined(MLPI_IMPORTS)
444 #define MLPI_API
445 #else
446 #define MLPI_API
447 #endif
448 #endif
449 
450 #ifdef __cplusplus
451 extern "C" {
452 #endif
453 
454 
460 
472 MLPI_API MLPIRESULT mlpiAccessControlGetUserPolicies(const MLPIHANDLE connection, MlpiUserPolicies* userPolicies);
473 
485 MLPI_API MLPIRESULT mlpiAccessControlGetPasswordPolicies(const MLPIHANDLE connection, MlpiPasswordPolicies* passwordPolicies);
486 
501 MLPI_API MLPIRESULT mlpiAccessControlGetAllUserInfos(const MLPIHANDLE connection, MlpiUserInfo* userInfos, const ULONG numElements, ULONG* numElementsRet);
502 
521 MLPI_API MLPIRESULT mlpiAccessControlAddUser(const MLPIHANDLE connection, MlpiUserDetails userDetails, const WCHAR16* tmpPassword);
522 
537 MLPI_API MLPIRESULT mlpiAccessControlGetUser(const MLPIHANDLE connection, const WCHAR16* username, MlpiUserDetails* userDetails);
538 
556 MLPI_API MLPIRESULT mlpiAccessControlSetUser(const MLPIHANDLE connection, MlpiUserDetails userDetails);
557 
570 MLPI_API MLPIRESULT mlpiAccessControlDeleteUser(const MLPIHANDLE connection, const WCHAR16* username);
571 
588 MLPI_API MLPIRESULT mlpiAccessControlChangePassword(const MLPIHANDLE connection, const WCHAR16* username, const WCHAR16* oldPassword, const WCHAR16* newPassword);
589 
604 MLPI_API MLPIRESULT mlpiAccessControlGetAllGroupInfos(const MLPIHANDLE connection, MlpiGroupInfo* groupInfos, const ULONG numElements, ULONG* numElementsRet);
605 
622 MLPI_API MLPIRESULT mlpiAccessControlGetAllGroupsOfUser(const MLPIHANDLE connection, const WCHAR16* username, WCHAR16* groupNames, const ULONG numElements, ULONG* numElementsRet);
623 
640 MLPI_API MLPIRESULT mlpiAccessControlGetAllUsersOfGroup(const MLPIHANDLE connection, const WCHAR16* groupName, WCHAR16* usernames, const ULONG numElements, ULONG* numElementsRet);
641 
655 MLPI_API MLPIRESULT mlpiAccessControlAddUserToGroup(const MLPIHANDLE connection, const WCHAR16* groupName, const WCHAR16* username);
656 
670 MLPI_API MLPIRESULT mlpiAccessControlRemoveUserFromGroup(const MLPIHANDLE connection, const WCHAR16* groupName, const WCHAR16* username);
671 
686 MLPI_API MLPIRESULT mlpiAccessControlSetUsersOfGroup(const MLPIHANDLE connection, const WCHAR16* groupName, const WCHAR16* usernames);
687 
702 MLPI_API MLPIRESULT mlpiAccessControlSetGroupsOfUser(const MLPIHANDLE connection, const WCHAR16* username, const WCHAR16* groupNames);
703 
715 MLPI_API MLPIRESULT mlpiAccessControlGetGroupPolicies(const MLPIHANDLE connection, MlpiGroupPolicies* groupPolicies);
716 
735 MLPI_API MLPIRESULT mlpiAccessControlResetPassword(const MLPIHANDLE connection, const WCHAR16* username, const WCHAR16* newPassword);
736 
752 MLPI_API MLPIRESULT mlpiAccessControlAddGroup(const MLPIHANDLE connection, MlpiGroupDetails groupDetails);
753 
754 
769 MLPI_API MLPIRESULT mlpiAccessControlGetGroup(const MLPIHANDLE connection, const WCHAR16* groupName, MlpiGroupDetails* groupDetails);
770 
787 MLPI_API MLPIRESULT mlpiAccessControlSetGroup(const MLPIHANDLE connection, MlpiGroupDetails groupDetails);
788 
801 MLPI_API MLPIRESULT mlpiAccessControlDeleteGroup(const MLPIHANDLE connection, const WCHAR16* groupName);
802 
817 MLPI_API MLPIRESULT mlpiAccessControlSetPermissionsOfGroup(const MLPIHANDLE connection, const WCHAR16* groupName, const WCHAR16* permissions);
818 
835 MLPI_API MLPIRESULT mlpiAccessControlGetAllPermissionsOfGroup(const MLPIHANDLE connection, const WCHAR16* groupName, WCHAR16* permissions, const ULONG numElements, ULONG* numElementsRet);
836 
851 MLPI_API MLPIRESULT mlpiAccessControlGetAllPermissions(const MLPIHANDLE connection, WCHAR16* permissions, const ULONG numElements, ULONG* numElementsRet);
852 
868 MLPI_API MLPIRESULT mlpiAccessControlSetAuthorizedGroupsOfPermission(const MLPIHANDLE connection, const WCHAR16* permission, const WCHAR16* groupNames);
869 
886 MLPI_API MLPIRESULT mlpiAccessControlGetAllAuthorizedGroupsOfPermission(const MLPIHANDLE connection, const WCHAR16* permission, WCHAR16* groupNames, const ULONG numElements, ULONG* numElementsRet);
887 
900 MLPI_API MLPIRESULT mlpiAccessControlAddPermissionToGroup(const MLPIHANDLE connection, const WCHAR16* groupName, const WCHAR16* permission);
901 
914 MLPI_API MLPIRESULT mlpiAccessControlRemovePermissionFromGroup(const MLPIHANDLE connection, const WCHAR16* groupName, const WCHAR16* permission);
915 
916 #ifdef __cplusplus
917 }
918 #endif
919 #endif /*__MLPIACCESSCONTROLLIB_H__*/
Unit of expiration time is in minutes.
struct MlpiAccessControlExpirationDetails MlpiAccessControlExpirationDetails
This structure provides information about the expiration settings applied to sessions and passwords...
MLPIRESULT mlpiAccessControlAddPermissionToGroup(const MLPIHANDLE connection, const WCHAR16 *groupName, const WCHAR16 *permission)
This function add a permission to a specified group.
signed char BOOL8
1 byte boolean
Definition: mlpiGlobal.h:158
MLPIRESULT mlpiAccessControlGetAllUsersOfGroup(const MLPIHANDLE connection, const WCHAR16 *groupName, WCHAR16 *usernames, const ULONG numElements, ULONG *numElementsRet)
This function obtains the user details of all the users assigned to the specified group...
struct MlpiGroupInfo MlpiGroupInfo
This structure provides all basic information about a specific group.
MLPIRESULT mlpiAccessControlGetGroupPolicies(const MLPIHANDLE connection, MlpiGroupPolicies *groupPolicies)
This function returns information regarding the policies that apply to all groups.
struct MlpiGroupDetails MlpiGroupDetails
This structure provides all detailed information about a specific group.
MLPIRESULT mlpiAccessControlSetUser(const MLPIHANDLE connection, MlpiUserDetails userDetails)
This function allows to modify the information of a user. Within the userDetails argument, the correct Id of the user (if known) or username must be given.
struct MlpiPasswordPolicies MlpiPasswordPolicies
This structure contains the policies to be followed to define the user passwords, such as password le...
struct MlpiGroupPolicies MlpiGroupPolicies
This structure contains the policies to be followed by a group.
MLPIRESULT mlpiAccessControlGetGroup(const MLPIHANDLE connection, const WCHAR16 *groupName, MlpiGroupDetails *groupDetails)
This function obtains the details of a specific group.
MLPIRESULT mlpiAccessControlSetGroup(const MLPIHANDLE connection, MlpiGroupDetails groupDetails)
This function allows to modify the information of a group. Within the groupDetails argument...
MLPIRESULT mlpiAccessControlSetGroupsOfUser(const MLPIHANDLE connection, const WCHAR16 *username, const WCHAR16 *groupNames)
This function sets the Groups of a User. It is capable of adding multiple new groups to a user or del...
#define MLPI_STRUCT_ALIGN_STRUCT
structure, dummy
Definition: mlpiGlobal.h:306
wchar_t WCHAR16
UTF16 string.
Definition: mlpiGlobal.h:193
MLPIRESULT mlpiAccessControlAddUser(const MLPIHANDLE connection, MlpiUserDetails userDetails, const WCHAR16 *tmpPassword)
This function adds a new user in the target that can be used for authentication. Once the user is add...
unsigned int ULONG
4 byte unsigned integer
Definition: mlpiGlobal.h:165
MLPIRESULT mlpiAccessControlAddGroup(const MLPIHANDLE connection, MlpiGroupDetails groupDetails)
This function adds a new group in the target that can be used for authorization.
MLPIRESULT mlpiAccessControlGetAllGroupInfos(const MLPIHANDLE connection, MlpiGroupInfo *groupInfos, const ULONG numElements, ULONG *numElementsRet)
This function provides information regarding all the groups of users currently supported by the user ...
MLPIRESULT mlpiAccessControlGetUser(const MLPIHANDLE connection, const WCHAR16 *username, MlpiUserDetails *userDetails)
This function obtains the user details of a specific user.
#define MLPI_STRUCT_ALIGN_BOOL8
1 byte boolean, aligned within structs to MLPI data type BOOL8
Definition: mlpiGlobal.h:287
MLPIRESULT mlpiAccessControlDeleteGroup(const MLPIHANDLE connection, const WCHAR16 *groupName)
This function deletes the group specified by the given group name.
#define MLPI_STRUCT_ALIGN_ENUM
enumeration, aligned within structs to 32 bit
Definition: mlpiGlobal.h:302
Unit of expiration time is in days.
#define MLPI_STRUCT_ALIGN_ULONG
4 byte unsigned integer, aligned within structs to MLPI data type ULONG
Definition: mlpiGlobal.h:296
MLPIRESULT mlpiAccessControlGetAllPermissionsOfGroup(const MLPIHANDLE connection, const WCHAR16 *groupName, WCHAR16 *permissions, const ULONG numElements, ULONG *numElementsRet)
This function obtains the permissions of the specified group.
MLPIRESULT mlpiAccessControlRemoveUserFromGroup(const MLPIHANDLE connection, const WCHAR16 *groupName, const WCHAR16 *username)
This function removes a user from specified group. In other words, the user will not be identified as...
MLPIRESULT mlpiAccessControlDeleteUser(const MLPIHANDLE connection, const WCHAR16 *username)
This function deletes a user specified by a given username.
struct MlpiDateAndTime MlpiDateAndTime
This structure defines the broken date and time information.
MLPIRESULT mlpiAccessControlRemovePermissionFromGroup(const MLPIHANDLE connection, const WCHAR16 *groupName, const WCHAR16 *permission)
This function removes a permission from the specified group.
MLPIRESULT mlpiAccessControlGetPasswordPolicies(const MLPIHANDLE connection, MlpiPasswordPolicies *passwordPolicies)
This function returns information regarding the policies that apply to all the user passwords...
MLPIRESULT mlpiAccessControlGetUserPolicies(const MLPIHANDLE connection, MlpiUserPolicies *userPolicies)
The user is available permanently until specified otherwise.
MLPIRESULT mlpiAccessControlGetAllGroupsOfUser(const MLPIHANDLE connection, const WCHAR16 *username, WCHAR16 *groupNames, const ULONG numElements, ULONG *numElementsRet)
This function provides the general group information of all the groups assigned to the specified user...
MlpiUserPersistenceType
This enumeration describes the possible persistence type of a user, whether it a temp or remanent use...
MLPIRESULT mlpiAccessControlSetPermissionsOfGroup(const MLPIHANDLE connection, const WCHAR16 *groupName, const WCHAR16 *permissions)
This function sets the permissions of the group specified by the given group name.
MLPIRESULT mlpiAccessControlGetAllPermissions(const MLPIHANDLE connection, WCHAR16 *permissions, const ULONG numElements, ULONG *numElementsRet)
This function obtains all permissions that are available (and therefore may be added to a group) on t...
struct MlpiUserInfo MlpiUserInfo
This structure provides all basic information about a specific user.
struct MlpiUserPolicies MlpiUserPolicies
This structure contains the policies to be followed by a user.
MLPIRESULT mlpiAccessControlSetAuthorizedGroupsOfPermission(const MLPIHANDLE connection, const WCHAR16 *permission, const WCHAR16 *groupNames)
This function assigns the specified permission(s) to the specified groups. The purpose of the functio...
struct MlpiUserDetails MlpiUserDetails
This structure provides all detailed information about a specific user.
MLPIRESULT mlpiAccessControlGetAllUserInfos(const MLPIHANDLE connection, MlpiUserInfo *userInfos, const ULONG numElements, ULONG *numElementsRet)
This function returns information regarding all the users currently found within the user manager loc...
MLPIRESULT mlpiAccessControlResetPassword(const MLPIHANDLE connection, const WCHAR16 *username, const WCHAR16 *newPassword)
This function sets a new password for a specific user (password reset). It is recommended that only u...
MLPIRESULT mlpiAccessControlSetUsersOfGroup(const MLPIHANDLE connection, const WCHAR16 *groupName, const WCHAR16 *usernames)
This function sets the Users of a Group. It is capable of adding multiple new users or deleting pre-e...
unsigned long MLPIHANDLE
common MLPI-API handle value
Definition: mlpiGlobal.h:206
MLPIRESULT mlpiAccessControlChangePassword(const MLPIHANDLE connection, const WCHAR16 *username, const WCHAR16 *oldPassword, const WCHAR16 *newPassword)
This function changes a user&#39;s password.
The user is only available temporarily.
MLPIRESULT mlpiAccessControlAddUserToGroup(const MLPIHANDLE connection, const WCHAR16 *groupName, const WCHAR16 *username)
This function add a user to a specified group. In other words, the user will be identified as a membe...
int MLPIRESULT
common MLPI-API return value
Definition: mlpiGlobal.h:198
MLPIRESULT mlpiAccessControlGetAllAuthorizedGroupsOfPermission(const MLPIHANDLE connection, const WCHAR16 *permission, WCHAR16 *groupNames, const ULONG numElements, ULONG *numElementsRet)
This function obtains the groups to which a specific permission is assigned.
#define MLPI_STRUCT_ALIGN_WCHAR16
2 byte char, aligned within structs to MLPI data type WCHAR16
Definition: mlpiGlobal.h:304
MlpiAccessControlExpirationTimeUnit
This enumeration describes the possible units that the expiration time can have (i.e. days or minutes).