ttomcat-1778514358873.zip-extract/_dependencies/maven/com.h2database_h2-2.2.220/org/h2/engine/Role.java

Path
ttomcat-1778514358873.zip-extract/_dependencies/maven/com.h2database_h2-2.2.220/org/h2/engine/Role.java
Status
scanned
Type
file
Name
Role.java
Extension
.java
Programming language
Java
Mime type
text/x-java
File type
Java source, ASCII text
Tag

      
    
Rootfs path

      
    
Size
2195 (2.1 KB)
MD5
534b994147a99a620e16618d01163d8d
SHA1
a1c181607d6bb085eae31fb73602c9fded3f2d7f
SHA256
94d4e13e7f48cb8ce0abdd67f286c5cff575ffa557628ed1a4cb656e2d705740
SHA512

      
    
SHA1_git
88efc306f496ab8f2f53089179b0ae1ea36af094
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
Role.java | 2.1 KB |

/* * Copyright 2004-2023 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ package org.h2.engine; import java.util.ArrayList; import org.h2.message.Trace; import org.h2.schema.Schema; /** * Represents a role. Roles can be granted to users, and to other roles. */ public final class Role extends RightOwner { private final boolean system; public Role(Database database, int id, String roleName, boolean system) { super(database, id, roleName, Trace.USER); this.system = system; } /** * Get the CREATE SQL statement for this object. * * @param ifNotExists true if IF NOT EXISTS should be used * @return the SQL statement */ public String getCreateSQL(boolean ifNotExists) { if (system) { return null; } StringBuilder builder = new StringBuilder("CREATE ROLE "); if (ifNotExists) { builder.append("IF NOT EXISTS "); } return getSQL(builder, DEFAULT_SQL_FLAGS).toString(); } @Override public String getCreateSQL() { return getCreateSQL(false); } @Override public int getType() { return DbObject.ROLE; } @Override public ArrayList<DbObject> getChildren() { ArrayList<DbObject> children = new ArrayList<>(); for (Schema schema : database.getAllSchemas()) { if (schema.getOwner() == this) { children.add(schema); } } return children; } @Override public void removeChildrenAndResources(SessionLocal session) { for (RightOwner rightOwner : database.getAllUsersAndRoles()) { Right right = rightOwner.getRightForRole(this); if (right != null) { database.removeDatabaseObject(session, right); } } for (Right right : database.getAllRights()) { if (right.getGrantee() == this) { database.removeDatabaseObject(session, right); } } database.removeMeta(session, getId()); invalidate(); } }
Detected license expression

      
    
Detected license expression (SPDX)

      
    
Percentage of license text
5.24
Copyrights
- end_line: 2
  copyright: Copyright 2004-2023 H2 Group. Multiple-Licensed
  start_line: 2
Holders
- holder: H2 Group. Multiple-Licensed
  end_line: 2
  start_line: 2
Authors

      
    
License expression License clue details
(mpl-2.0 OR epl-1.0) AND proprietary-license {'score': 20.37, 'matcher': '3-seq', 'end_line': 3, 'rule_url': 'https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/mpl-2.0_or_epl-1.0_and_proprietary-license_2.RULE', 'from_file': None, 'start_line': 2, 'matched_text': ' * Copyright 2004-2023 H2 Group. Multiple-Licensed under the MPL 2.0,\n * and the EPL 1.0 (https://h2database.com/html/license.html).', 'match_coverage': 20.37, 'matched_length': 11, 'rule_relevance': 100, 'rule_identifier': 'mpl-2.0_or_epl-1.0_and_proprietary-license_2.RULE', 'license_expression': '(mpl-2.0 OR epl-1.0) AND proprietary-license', 'license_expression_spdx': '(MPL-2.0 OR EPL-1.0) AND LicenseRef-scancode-proprietary-license'}
URL Start line End line
https://h2database.com/html/license.html 3 3
Package URL License Primary language
pkg:osgi/com.h2database.source@2.2.220