1. Technical Field
The present invention relates generally to an improved data processing system and in particular to a method for providing sectional access privileges for plain text files on a per user basis. Still more particularly, the present invention provides a method for subdividing a plain text file into sections and assigning access privileges to the sections of the text file on a per user basis.
2. Description of Related Art
Conventional file permissions allow users to restrict read and write access to a file. For example, a first set of users may be granted only read access to a file and thus can only view the file, while another set of users may be granted read and write privileges to the same file and thus can modify the file in addition to viewing the file. While conventional file permissions facilitate granting of various access privileges among users, such implementations provide access privileges on a per file basis.
Some file formats, such as the Adobe Portable Document Format, implement security controls which allow certain users to have write access to a file, while restricting other users to read-only access. However, the writeable sections of an Adobe Portable Document File are presented as writeable to any user with write privileges to the file. Additionally, any user having read-access to an Adobe Portable Document File is able to view all sections of the file. That is, both read and write privileges are enforced for the entire file.
It would be advantageous to provide a mechanism for providing read and write access privileges for plain text files on a per user basis. It would be further advantageous to provide a mechanism for providing access privileges to plain text files such that a plain text file may have different access privileges assigned to users for various sections of the text file.
The present invention provides a method, computer program product, and a data processing system for providing sectional access to a file on a per-user basis. A plurality of sections of a text file are designated. A respective read access privilege attribute and a respective write access privilege attribute are associated with a user of an application program for each of the plurality of sections. A read access privilege attribute and a write access privilege attribute corresponds to one of the plurality of sections. Any of the plurality of sections to which the user has an associated read access privilege attribute that indicates the user does not have permission to read the respective section are prohibited from display in the application program.
The novel features believed characteristic of the invention are set forth in the appended claims. The invention itself, however, as well as a preferred mode of use, further objectives and advantages thereof, will best be understood by reference to the following detailed description of an illustrative embodiment when read in conjunction with the accompanying drawings, wherein:
The preferred embodiment of the present invention and its advantages are best understood by referring to
With reference now to the figures,
In the depicted example, server 104 is connected to network 102 along with storage unit 106. In addition, clients 108, 110, and 112 are connected to network 102. These clients 108, 110, and 112 may be, for example, personal computers or network computers. In the depicted example, server 104 provides data, such as boot files, operating system images, and applications to clients 108-112. Clients 108, 110, and 112 are clients to server 104. Network data processing system 100 may include additional servers, clients, and other devices not shown. In the depicted example, network data processing system 100 is the Internet with network 102 representing a worldwide collection of networks and gateways that use the Transmission Control Protocol/Internet Protocol (TCP/IP) suite of protocols to communicate with one another. At the heart of the Internet is a backbone of high-speed data communication lines between major nodes or host computers, consisting of thousands of commercial, government, educational and other computer systems that route data and messages. Of course, network data processing system 100 also may be implemented as a number of different types of networks, such as for example, an intranet, a local area network (LAN), or a wide area network (WAN).
Referring to
Peripheral component interconnect (PCI) bus bridge 214 connected to I/O bus 212 provides an interface to PCI local bus 216. A number of modems may be connected to PCI local bus 216. Typical PCI bus implementations will support four PCI expansion slots or add-in connectors. Communications links to clients 108-112 in
Additional PCI bus bridges 222 and 224 provide interfaces for additional PCI local buses 226 and 228, from which additional modems or network adapters may be supported. In this manner, data processing system 200 allows connections to multiple network computers. A memory-mapped graphics adapter 230 and hard disk 232 may also be connected to I/O bus 212 as depicted, either directly or indirectly.
Those of ordinary skill in the art will appreciate that the hardware depicted in
The data processing system depicted in
With reference now to
An operating system runs on processor 302 and is used to coordinate and provide control of various components within data processing system 300 in
Those of ordinary skill in the art will appreciate that the hardware in
As another example, data processing system 300 may be a stand-alone system configured to be bootable without relying on some type of network communication interface. As a further example, data processing system 300 may be a personal digital assistant (PDA) device, which is configured with ROM and/or flash ROM in order to provide non-volatile memory for storing operating system files and/or user-generated data.
The depicted example in
In accordance with a preferred embodiment of the present invention, sections 402-404 may have file permissions designated therefor on a per user basis. Sections 402-404 include a subset of text data of plain text file 400. For example, each of sections 402-404 may have read access or write access privileges granted to users, such as users of clients 108-112. Accordingly, a user may be granted read or write access to text file 400 while particular sections may be hidden and thus unviewable to the user while other sections are presented for viewing or modification by the user. Sections 402-404 may be addressed or identified by, for example, respective pointers 410-412, memory offsets, or another suitable addressing mechanism.
Table 500 comprises a plurality of records 520 and fields 530. Table 500 may be stored on hard disk 232, fetched therefrom by processor 202, and processed by data processing system 200 shown in
Table 500 has a label, or identifier, assigned thereto. In the present example, table 500 has a label of “RWAccess.” Fields 530a-530c have respective labels, or identifiers, that facilitates insertion, deletion, querying, or other data operations or manipulations of table 500. In the illustrative example, fields 530a-530c have respective labels of “User”, “File”, and “R_W”. A particular field, e.g., field 530a, may be designated as a key field and each respective data element is unique within key field 530a. Assignment of unique values to data elements of key field 530a provides an identifier for records 520a-520c, and the collection of data elements of key field 530a is typically referred to as an index. Addressing a particular record 520a-520c via an associated data element of key field 530a is referred to herein as indexing of record 520a-520c. Alternatively, a key may be obtained by a function, e.g., a hashing function, that indexes a particular record 520a-520c.
In the illustrative example, key field 530a has an identifier User and data elements of key field 530a comprise unique values associated with users that may access, or attempt access, to a text file. For example, data elements of key field 530a may comprise network addresses of clients 108-112 that are associated with individual users of network data processing system 100.
Field 530b contains data elements that specify a file to which user access may be granted or denied. In the illustrative example, field 530b comprises data elements of “textfile1.txt” that identify text file 400 described with reference to
In accordance with a preferred embodiment of the present invention, a text file access routine interrogates table 500 with a user identifier to determine if the user has read or write privileges responsive to a request by the user to view a text file, e.g., an attempt to open the text file. The user identifier may comprise, for example, an IP address of a client, such as client 108 shown in
Table 600 has a label of “Sect_Priv”. Fields 630a-630d have respective labels of “User”, “Section1_R_W”, Section2_R_W”, and Section3_R_W. In the illustrative example, field 630a comprises a key field of table 600 and has data elements that specify users. In the illustrative example, only users that have read access to text file 400 according to field 530c of table 500 have a corresponding entry in table 600. Thus, each of users User2 and User3 have a respective record 620a and 620b included in table 600.
Fields 630b-630d contain data elements that respectively specify user access privileges to a section of text file document 400. In the illustrative example, fields 630b-630d comprise CSD data elements with a first CSD value of each CSD data element comprising a reference or other identification of a section of text file 400. Second and third CSD values of each CSD data element comprise a Boolean value of true (T) or false (F) that respectively define read and write access privilege attributes of the text file section specified by the first CSD value of the corresponding CSD data element. For example, field 630b of record 620a has a CSD data element of “PTR1, T, F”. The first CSD value PTR1 of the CSD data element references section 402 of text file 400. The second CSD value “T” of the CSD data element indicates that the user User2 specified in field 630a of record 620a has read access privileges to section 402 specified by the first CSD value of the CDS data element. Likewise, the third CSD value “F” of the CSD data element indicates that the user User2 does not have write privileges to section 402. In a similar manner, fields 630c and 630d comprise CSD data elements that specify respective sections 403 and 404 and the read and write access privileges to be granted to the user. Thus, for example, User3 may both read and write to section 402 of text file 400 but may only read section 403 of text file 400 as the third CSD value of the CSD data element of record 620b and field 630c indicates that the user may not write to section 403. The CSD value of the CDS data element in field 630d of record 620b indicates that the user User3 may neither read nor write to section 404. Thus, section 404 will be hidden from the user User3 when viewing text file 400.
Responsive to privilege manager application 708 verifying that the user of application 702 has an access privilege to the requested text file, additional evaluation of the user's access privileges to the requested text file is then made by privilege access manager application 708. Particularly, privilege access manager 708 identifies sections of the requested text file that have access privileges associated therewith. The user's access privileges for sections of the text file are then evaluated, and only sections to which the user has read or write privileges are conveyed to text application program 702 for display. Additionally, when text application program 702 attempts to perform a write operation to the text file responsive to a user input, the privilege access manger application 708 preferably identifies a section of the text file to which the write operation is directed and evaluates whether the user has write privileges to the identified section. The write operation is only permitted if the user has a write privilege to the identified section.
If the user is determined to have access to the requested file at step 806, a counter variable i is initialized to 1 (step 810), and a section i of the requested file is evaluated to determine if it is to be hidden from the user (step 812). That is, an evaluation is made to determine if the user does not have a read access privilege to the section i. If the section i of the requested file is to be hidden, the file access routine proceeds to determine if additional sections in the text file remain for evaluation (step 816).
Returning again to step 812, if the section i of the text file is not be hidden from the user, the file access routine temporarily stores the section i (step 814) and proceeds to evaluate whether the requested text file includes additional sections for evaluation according to step 816. The file access routine proceeds to increment the counter variable i (step 818) and returns to step 812 to evaluate the next section i to determine if it is to be hidden from the user.
When all sections of the requested file have been evaluated according to step 816, the file access routine then formats the file sections stored according to step 814 for display (step 820). For example, the stored sections may be sequentially appended in order of evaluation or otherwise concatenated into a contiguous data structure. The text file sections formatted according to step 820 are then conveyed to the requesting text application program for display (step 822), and the file access routine then ends according to step 824.
Returning again to step 908, in the event that the write access routine determines that the user has a write privilege for the identified section, the input text is written to the identified section (step 912), and the write access routine proceeds to determine if additional user input for a write operation is provided according to step 914. If additional input is provided by the user for a write operation at step 914, the write access routine returns to step 906 to identify the text file section to which the text write is directed. Alternatively, the write access routine cycle ends (step 916).
Thus, a method and system for providing sectional access privileges to text files on a per user basis is provided by the present invention. Users may have read and write access privileges assigned to text files. A user having at least a read access privilege to a text file additionally has read and write access privileges defined for sections of the text file. Thus, one or more sections of a text file may be hidden from a user having read or write access privileges to the text file, and the user may be prohibited from writing to one or more text file sections that are viewable to the user.
It is important to note that while the present invention has been described in the context of a fully functioning data processing system, those of ordinary skill in the art will appreciate that the processes of the present invention are capable of being distributed in the form of a computer readable medium of instructions and a variety of forms and that the present invention applies equally regardless of the particular type of signal bearing media actually used to carry out the distribution. Examples of computer readable media include recordable-type media, such as a floppy disk, a hard disk drive, a RAM, CD-ROMs, DVD-ROMS, and transmission-type media, such as digital and analog communications links, wired or wireless communications links using transmission forms, such as, for example, radio frequency and light wave transmissions. The computer readable media may take the form of coded formats that are decoded for actual use in a particular data processing system.
The description of the present invention has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the invention in the form disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art. The embodiment was chosen and described in order to best explain the principles of the invention, the practical application, and to enable others of ordinary skill in the art to understand the invention for various embodiments with various modifications as are suited to the particular use contemplated.