Make the SQLForm use the new functions inside DatabaseLink to do database
privilege checking. This fixes the newest bug about database permissions on the bug boards.
This commit is contained in:
parent
73d85203d5
commit
a698b2c4f3
2 changed files with 7 additions and 2 deletions
|
|
@ -76,6 +76,8 @@
|
|||
- fix: Self-deactivation doesn't show login screen after success
|
||||
- fix regression: Calendar events on the last day of the month do not appear on the month view
|
||||
http://www.webgui.org/bugs/tracker/fixed-calendar-events-on-the-last-day-of-the-month-do-not-appear-on-the-month-view
|
||||
- fix: SQLForm says Databaselink does not have enough privileges (perlDreamer Consulting, LLC)
|
||||
http://www.webgui.org/bugs/tracker/sqlform-says-databaselink-does-not-have-enough-privileges
|
||||
|
||||
7.3.20
|
||||
- Added beta label to the beta components in the system, so people can more
|
||||
|
|
|
|||
|
|
@ -610,7 +610,8 @@ sub _createFieldType {
|
|||
|
||||
=head2 _databaseLinkHasPrivileges ( wantedPrivileges, databaseLink )
|
||||
|
||||
Returns true if the database link has at least the given privileges.
|
||||
Returns true if the database link has at least the given privileges. This method is
|
||||
deprecated. Please use the checkPrivileges method in WebGUI::DatabaseLink instead.
|
||||
|
||||
=head3 wantedPrivileges
|
||||
|
||||
|
|
@ -676,6 +677,8 @@ sub _databaseLinkHasPrivileges {
|
|||
foreach (@$wantedPrivileges) {
|
||||
return 0 unless (isIn(uc($_), @privileges));
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -1243,7 +1246,7 @@ sub processPropertiesFromFormPost {
|
|||
# $dbLink->db will raise a fatal error if there is a connection error.
|
||||
# return ["Can't connect to database through the selected database link"] unless ($dbLink->db);
|
||||
|
||||
unless ($self->_databaseLinkHasPrivileges([qw(ALTER CREATE DELETE INDEX INSERT SELECT UPDATE)], $dbLink)) {
|
||||
unless ($dbLink->checkPrivileges([qw(ALTER CREATE DELETE INDEX INSERT SELECT UPDATE)])) {
|
||||
return ["Databaselink does not have enough privileges (Needs ALTER, CREATE, DELETE, INDEX, INSERT, SELECT, UPDATE)"];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue