KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > iapi > sql > dictionary > StatementPermission


1 /*
2
3    Derby - Class org.apache.derby.iapi.sql.dictionary.StatementPermission
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to you under the Apache License, Version 2.0
9    (the "License"); you may not use this file except in compliance with
10    the License. You may obtain a copy of the License at
11
12       http://www.apache.org/licenses/LICENSE-2.0
13
14    Unless required by applicable law or agreed to in writing, software
15    distributed under the License is distributed on an "AS IS" BASIS,
16    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17    See the License for the specific language governing permissions and
18    limitations under the License.
19
20  */

21
22 package org.apache.derby.iapi.sql.dictionary;
23
24 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
25 import org.apache.derby.iapi.error.StandardException;
26
27 /**
28  * This class describes a permission require by a statement.
29  */

30
31 public abstract class StatementPermission
32 {
33     /**
34      * Restrict implementations to this package to reduce
35      * risk of external code spoofing the GRANT/REVOKE system
36      * by providing its own fake implementations.
37      *
38      */

39     StatementPermission()
40     {
41     }
42     /**
43      * @param lcc LanguageConnectionContext
44      * @param authorizationId AuthorizationId
45      * @param forGrant
46      *
47      * @exception StandardException if the permission has not been granted
48      */

49     public abstract void check( LanguageConnectionContext lcc,
50                                 String JavaDoc authorizationId,
51                                 boolean forGrant) throws StandardException;
52
53     /**
54      *
55      * Get the PermissionDescriptor for the passed authorization id for this
56      * object. This method gets called during the execution phase of create
57      * view/constraint/trigger. The return value of this method is saved in
58      * dependency system to keep track of views/constraints/triggers
59      * dependencies on required permissions. This happens in execution phase
60      * after it has been established that passed authorization id has all the
61      * permissions it needs to create that view/constraint/trigger. Which means
62      * that we can only get to writing into dependency system once all the required
63      * privileges are confirmed.
64      *
65      * @param authid AuthorizationId
66      * @param dd DataDictionary
67      *
68      * @return PermissionsDescriptor The PermissionDescriptor for the passed
69      * authorization id on this object
70      *
71      * @exception StandardException
72      */

73     public abstract PermissionsDescriptor getPermissionDescriptor(String JavaDoc authid, DataDictionary dd)
74     throws StandardException;
75 }
76
Popular Tags