Commit Graph

39 Commits

Author SHA1 Message Date
chfhtw b11d8d056a get access rights from permissionlib 2026-03-24 15:15:12 +01:00
Harald Bamberger e809e48262 fix order of parameters 2025-03-31 15:40:18 +02:00
Harald Bamberger 1691c75a84 replace dependencies on legacy code with ci model functions 2024-11-07 19:18:08 +01:00
Harald Bamberger d4494836b1 fix file permissions erroneously commited as a21a292da6 2024-10-17 15:34:00 +02:00
Harald Bamberger a8141e5dac Merge branch 'master' into feature-25999/C4 2024-09-09 11:45:10 +02:00
Harald Bamberger 115151473a backport recent changes of Betriebsmittel component and phrases from feature-30660/FHC4_StudierendenGUI_Prototyp Branch 2024-07-11 11:57:45 +02:00
SimonGschnell 9db09a040a Merge branch 'master' into feature-25999/C4_ma0594_profilePage 2024-05-08 09:58:18 +02:00
cgfhtw 68459e086a Auth_Controller special permissions 2024-03-06 16:15:04 +01:00
SimonGschnell a21a292da6 dokument upload 2024-01-29 16:48:41 +01:00
Paolo 3bfe1cdeea - Fixed messages and comments in PermissionLib
- JobsQueueManager->addNewJobsToQueue now checks permission to write new jobs in the queue
- Added statuses for system.tbl_jobstatuses in system/dbupdate_3.3.php
- Added permission access type (read/write) in configuration file application/config/jqm.php
2020-03-05 18:48:26 +01:00
Cris 615ed03fbe Added method getOE_isEntitledFor()
The method checks permission of the logged in user and retrieves all
organisational units this user is entitled for.
2019-09-19 13:28:15 +02:00
hainberg b910f220ac Added method getSTG_isEntitledFor to retrieve STG by entitlement of user 2019-08-29 14:07:45 +02:00
Paolo 3b4012798f Fixed some comments typo 2019-04-30 13:13:34 +02:00
Paolo 3abc2e2948 Merge branch 'master' into ciauth 2019-03-21 17:04:51 +01:00
Paolo 400a1adfde - Added new entry permission_loginas_personids_blacklist in config file permission.php
- Renamed method loginAS to loginASByUID in AuthLib.php
- Added new public method loginASByPersonId to AuthLib.php
- Renamed method connect to anonymousConnect in LDAPLib
- Method LDAPLib->connectUsernamePassword now checks both username and password if they are empty strings
- Added new constant LOGINAS_PERSONIDS_BLACKLIST to PermissionLib
- Renamed method isEntitledLoginAS to isEntitledLoginASByUID in PermissionLib
- Added new public method isEntitledLoginASByPersonId to PermissionLib
- Added new private method _inLAPersonIdsBlacklist to PermissionLib
2019-03-21 15:36:22 +01:00
Andreas Österreicher fe4017c786 Added function to install extensions from commandline 2019-03-20 16:30:44 +01:00
Paolo 04b1ec327a - Added new config file permission.php
- It contains the following entries:
	- List of permissions that are allowed to perform loginAs
	- List of permissions that cannot be gained with loginAs
	- List of users whose identity cannot be obtained with loginAs
- Removed config entries authentication_loginas_perms and authentication_loginas_blacklist from config file auth.php
- Added constants to PermissionLib: LOGINAS_ALLOWED, LOGINAS_BLACKLIST and LOGINAS_USERS_BLACKLIST
- PermissionLib loads the config file permission.php
- Added public method isEntitledLoginAS to PermissionLib
- Added private methods _inLAUsersBlacklist, _hasLANotAllowedPermissions and _hasLAPermissions to PermissionLib
- Added public method loginAS to AuthLib
- Fixed logout method in AuthLib
- Fixed loginLDAP method in AuthLib
2019-03-13 18:07:15 +01:00
Paolo aefd210273 - Added new configuration file auth.php for authentication
- Added new configuration file ldap.php for LDAP connection
- Added new controller system/Login to manage logins
- Added new controller system/Logout to manage logout
- Added new core model LDAP_Model to manage LDAP connections
- Added new constants in config/constants for authentication
- Added new function getCode to hlp_message_helper
- Now core/Auth_Controller loads the AuthLib as first step
- Now PermissionLib does NOT load anymore the AuthLib
- Removed old logic from PermissionLib
- Now function getAuthUID (hlp_authentication_helper) does not load anymore the AuthLib
- Now REST_Controller loads hlp_message_helper and hlp_common_helper
- core/APIv1_Controller does NOT load anymore hlp_message_helper and hlp_common_helper
- Added new constants to AuthLib
- AuthLib constructor now accept a parameter to enable the authentication immediatly (default)
- AuthLib loads configuration file auth.php and Person_model by default
- Added public methods getAuthObj and logout to AuthLib
- Renamed CheckUserAuthByUsernamePassword to checkUserAuthByUsernamePassword, CheckUserAuthByCode to checkUserAuthByCode and CheckUserAuthByCodeEmail to checkUserAuthByCodeEmail in AuthLib
- Added private methods _createAuthObj, _isLogged, _showInvalidAuthentication, _showError, _checkBTAuthentication, _checkHBALDAPAuthentication, _checkLDAPAuthentication, _checkForeignAuthentication, _storeAuthObj and _authenticate to AuthLib
2019-03-12 11:33:01 +01:00
Paolo fdddb52259 - Moved REST_Controller from libraries to core directory
- Changed the relatives includes
- Changed the controller api/v1/CheckUserAuth to be adapted to the AuthLib changes
- Removed function auth from helpers/hlp_authentication_helper
- Adapted function getAuthUID of helpers/hlp_authentication_helper to the AuthLib changes
- Adapted constructor of PermissionLib to the AuthLib changes
2019-02-27 11:24:27 +01:00
Paolo 9ff3eeff75 - PermissionLib uses isEmptyArray, added comments
- Added requiredPermissions property to the navigation array in the config navigation.php
- Added constant PERMISSION_NAVIGATION_METHOD to NavigationLib
- Added parameter and array element requiredPermissions to method oneLevel of NavigationLib
- Renamed method _sortArray to _sortNavigationArray in NavigationLib
- Added private method _rmNotAllowedEntries to NavigationLib to remove menu entries that the logged user is not allow to use
2018-06-29 12:31:45 +02:00
Paolo 845975ebfe Method hasAtLeastOne of PermissionLib can check permissions with a fixed given permission type
or retrive the permission type from each element of the requiredPermissions array
2018-06-29 12:02:05 +02:00
Paolo 2cba129076 - Added method hasAtLeastOne to the library PermissionLib
- Adapted the method isAllowed of the library FiltersLib to use hasAtLeastOne
- Corrected/added comments
2018-06-29 11:51:16 +02:00
Paolo 99292f93a7 PermissionLib->isEntitled is NOT checking anymore if the HTTP method to access to the
controller method is POST or GET to define what permission type (RW/SUID) is needed
2018-06-28 16:34:26 +02:00
Paolo 8f566e0499 Auth_Controller is now able to display a better message if the user is unauthorized
This message contains:
- the name of the called controller
- the name of the called method of the called controller
- all the possible permissions and related modes needed to acces to this content
2018-06-28 16:09:12 +02:00
Paolo 46e85a2317 Merge branch 'master' into permissions 2018-06-28 14:52:09 +02:00
Paolo d04b0450da - AuthLib is loaded only in fhcauth_helper, PermissionLib and REST_Controller
- Removed all the NOT usefull loads of helpers and libraries
- Fixed undefined index in controllers/system/UDF and model system/UDF_model
- APIv1_Controller now loads helper fhcauth
- FHC_Controller now loads ithe fhc and session helpers too
- Added/Fixed comments
- PermissionLib does NOT use anymore the getAuthUID function from the fhcauth helper, now relies on AuthLib directly
- REST_Controller loads directly the AuthLib when is needed
2018-06-27 13:12:46 +02:00
Paolo dda27c7d6e - Removed method isEntitled from PermissionLib
- Renamed method checkPermissions to isEntitled
- isEntitled: if the controller is called from the command line, then is always trusted
- Adapted controllers application/core/APIv1_Controller.php and application/core/FHC_Controller.php
2018-03-29 12:23:05 +02:00
Paolo 1f2450cf17 - Moved _checkPermissions from FHC_Controller to PermissionLib (now is public and it's renamed checkPermissions)
- Added include of PermissionLib in APIv1_Controller
- Added method _isAllowed to APIv1_Controller to call checkPermissions from PermissionLib
- Now the APIv1_Controller constructor requires an array of permissions as parameter
2018-03-20 13:00:35 +01:00
Paolo 34f7d335ed Added a check of the user permissions in the FHC_Controller
- FHC_Controller includes PermissionLib
- Added new method _isAllowed to FHC_Controller
- Added permission _checkPermissions to FHC_Controller
- Added new constants to PermissionLib
2018-03-16 15:18:19 +01:00
Andreas Österreicher d3d4e01afc isBerechtigt is now a Public Method of PermissionLib 2017-11-24 17:11:18 +01:00
Andreas Österreicher 39392d7c18 - Added Cronjob for correcting Studienplan in Status
- Modified persmission lib to not check persmissions on CLI
- Modified Cronjobs to be able to start CI Jobs
2017-10-24 11:13:59 +02:00
Paolo d8cd786079 - application/core/* -> CS compliant
- application/libraries/* -> CS compliant
- FHC_Model isEntitled method now return error() or success()
- Updated all code that uses isEntitled method from FHC_Model
- Removed Squiz.PHP.DisallowSizeFunctionsInLoops from CS ruleset
- Removed depracated method replace from DB_Model
- Removed unused method pgArrayPhp from DB_Model
- Renamed method arrayMergeIndex to _arrayCombine in DB_Model and set as private
- Added method _manageUDFs to DB_Model (a wrapper for UDFLib->manageUDFs)
2017-08-22 16:24:51 +02:00
Paolo 26c4865c43 - Property bb of PermissionLib is now static and is initialized in the
constructor, to have better performance.
- Method isBerechtigt has been renamed to _isBerechtigt
- Removed logs debug from _isBerechtigt
2017-06-21 14:02:24 +02:00
Paolo 5e3c8d8421 Replaced global constant FCPATH with FHCPATH 2017-06-21 11:30:45 +02:00
oesi 870f088549 Added Permission Logging in Debug Mode 2017-04-27 09:01:52 +02:00
bison-paolo 8e0ca12deb - All permission functionalities now are in the library PermissionLib
- All return messages functions are in the message helper and it is loaded by the core classes
- Added the missing constant FHC_NOPK
- Updated all the interested classes with the new permission method
- Updated all the interested classes with the new return message functions
2016-10-13 17:53:12 +02:00
paolo c8c580131c - Moved all the logic from controller PCRM to PCRMLib
- Extended functionality to others HTTP methods
- Added checking permissions if the requested resource is a library
(permissions are automatically handled by models) using PermissionLib
- Extended PermissionLib
2016-08-01 14:07:40 +02:00
paolo 9a4f5480c4 - Added permission basis/phrase to dump.sql
- The function getAuthUID() present in the helper fhcauth_helper.php
now tries to work always with CI session to get the uid
- REST_controller doesn't need anymore to handle the uid
- FHC_Controller and FHC_Model load fhcauth_helper in their constructor,
so any class that extends them now could call the function getAuthUID()
anywhere in the code
- The controllers don't need anymore to pass the uid to the models or to the
libraries
- Library FHC_DB_ACL load fhcauth_helper in its constructor and uses getAuthID()
2016-06-24 13:22:27 +02:00
Paminger 4c58b95728 Libs and Vorlagen 2016-06-17 00:12:46 +02:00