Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add $methods and $tables array and $table_prefix #12

Open
lievenjanssen opened this issue Jun 4, 2014 · 1 comment
Open

Add $methods and $tables array and $table_prefix #12

lievenjanssen opened this issue Jun 4, 2014 · 1 comment

Comments

@lievenjanssen
Copy link

I would like to add a $tables array with allowed tables and a possible $table_prefix in the code.

Suggested approach:

  • add $tables array and $table_prefix variable after the $dsn variable
  • add static function Allowed in ArrestDB class which checks if a certain table is available in the $tables array and otherwise exits with a 403 (just like for the $clients array)
  • add '$table = $table_prefix.$table; ArrestDB::Allowed($table);' to each ArrestDB::Serve function implementation

Can I add it and is this the right approach?

@lievenjanssen lievenjanssen changed the title Add $tables array and $table_prefix Add $methods and $tables array and $table_prefix Jun 4, 2014
@alixaxel
Copy link
Owner

This is totally possible. I'm not sure why add another layer of complexity atop of ArrestDB tho:

  • you could simply create a user that's only allowed to read/write certain tables and use that DSN
  • I've never been a big fan of table prefixes, why wouldn't you want to access the table explicitly?

@alixaxel alixaxel self-assigned this Jun 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants