OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 177 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 177 Rev 182
Line 1... Line 1...
1
/*
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 * 
3
 * 
4
 * Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
4
 * Copyright 2011-2019 OpenConcerto, by ILM Informatique. All rights reserved.
5
 * 
5
 * 
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
7
 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
7
 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
8
 * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
8
 * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
9
 * language governing permissions and limitations under the License.
9
 * language governing permissions and limitations under the License.
Line 18... Line 18...
18
import static org.openconcerto.sql.view.list.ITableModel.SleepState.SLEEPING;
18
import static org.openconcerto.sql.view.list.ITableModel.SleepState.SLEEPING;
19
 
19
 
20
import org.openconcerto.sql.Log;
20
import org.openconcerto.sql.Log;
21
import org.openconcerto.sql.element.SQLComponent;
21
import org.openconcerto.sql.element.SQLComponent;
22
import org.openconcerto.sql.model.SQLRowAccessor;
22
import org.openconcerto.sql.model.SQLRowAccessor;
23
import org.openconcerto.sql.model.SQLRowValues;
-
 
24
import org.openconcerto.sql.model.SQLTable;
23
import org.openconcerto.sql.model.SQLTable;
25
import org.openconcerto.sql.users.rights.TableAllRights;
24
import org.openconcerto.sql.users.rights.TableAllRights;
26
import org.openconcerto.sql.users.rights.UserRights;
25
import org.openconcerto.sql.users.rights.UserRights;
27
import org.openconcerto.sql.users.rights.UserRightsManager;
26
import org.openconcerto.sql.users.rights.UserRightsManager;
28
import org.openconcerto.sql.view.list.search.SearchQueue;
27
import org.openconcerto.sql.view.list.search.SearchQueue;
Line 490... Line 489...
490
 
489
 
491
    private boolean isReadOnly(final int rowIndex, final int columnIndex, final SQLTableModelColumn col) {
490
    private boolean isReadOnly(final int rowIndex, final int columnIndex, final SQLTableModelColumn col) {
492
        final ListSQLLine line = getRow(rowIndex);
491
        final ListSQLLine line = getRow(rowIndex);
493
        if (!line.getSrc().isCellEditable(line, columnIndex, col))
492
        if (!line.getSrc().isCellEditable(line, columnIndex, col))
494
            return true;
493
            return true;
495
        final SQLRowValues r = line.getRow();
494
        final SQLRowAccessor r = line.getRowAccessor();
496
        return r.getTable().contains(SQLComponent.READ_ONLY_FIELD) && SQLComponent.isReadOnly(r);
495
        return r.getTable().contains(SQLComponent.READ_ONLY_FIELD) && SQLComponent.isReadOnly(r);
497
    }
496
    }
498
 
497
 
499
    private boolean hasRight(final SQLTableModelColumn col) {
498
    private boolean hasRight(final SQLTableModelColumn col) {
500
        final UserRights u = UserRightsManager.getCurrentUserRights();
499
        final UserRights u = UserRightsManager.getCurrentUserRights();