Comments (3)
This is application logic and should be implemented in a plugin function. You can do that using the setting $LOGIN['initializer_proc']
or $APP['preprocess_func']
(these are called at the very beginning of processing), sometimes we also do it in $APP['menu_complete_proc']
, because often the menu items need to be adapted based on user roles as well.
You can check whether someone is logged in via function is_logged_in()
. The ID of the logged in user is in $_SESSION['user_id']
and the other user details are in $_SESSION['user_data']
from dbwebgen.
Why
$TABLES = array (
'accommodations' => array (
'display_name' => $__arr['Accommodations'],
'description' => '',
'item_name' => $__arr['Accommodation'],
'actions' => $ALL_ACTIONS <- ISN'T ROLE/USER BASED
'fields' => array (
there's no rights config in $TABLES ? I'll try to hide menus concerning creation of elements but I'm afraid consequently, following "add item" near field which is a reference to another table user still will be able to create items and so on...
I'd like to write such code
$RIGHTS = array(
0 => array( //--can edit EVERYTHING
'accommodations' => $ALL_ACTIONS,
'clients' => $ALL_ACTIONS,
),
1 => array( //--can't edit users
'accommodations' =>array(),
'clients' => $ALL_ACTIONS,
),
2 => array( //--can edit only reference books
'accommodations' => array(),
'clients' => $ALL_ACTIONS
)
);
foreach ($TABLES as $key => $value) {
$value["actions"] = $RIGHTS[$_SESSION["user_id"]][$key];
}
from dbwebgen.
The answer is in my previous comment. Roles and associated rights are application specific and therefore not part of the global settings. You need to use one of the functions mentioned in my above comment to modify menus and allowed table actions based on the logged-in user with your $RIGHTS array.
from dbwebgen.
Related Issues (20)
- dynamic loading of looking fields: use search_string_transformation setting HOT 1
- limit results in dynamically loaded T_LOOKUP boxes
- add default caching behavior for query visualizations
- confirm unsaved changed when navigating away from edit page
- when editing an upload field, allow to leave file empty
- allow prefilled form fields in records created via field/lookup
- Enable merging of records
- Validation support. date data type support HOT 6
- T_ForeignKeyLookup not updated
- bootstrap dependencies HOT 5
- Mysql HOT 1
- built-in form validation for N:M tables with additional required fields
- Bootstrap / popover bug
- Reversed 1:N relationship missing
- Search Function always returns no results HOT 4
- Charts & SQL query box HOT 1
- [PROPOSAL] Table view
- npm install warnings
- Problem with order of numeric values in queries. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dbwebgen.