ObjectStore C++ API Reference

os_segment_access

Instances of the class os_segment_access serve to associate zero or more access types with a group of a specified name, as well as with the default group.

By associating an os_segment_access with a segment (using os_segment::set_access_control()), you specify the segment's associated primary group and the segment's permissions.

The owner of a segment always has both read and write access to it.

The possible combinations of access types are represented by the following enumerators:

Note that write access without read access cannot be specified.

These enumerators are used as arguments to some of the members of os_segment_access.

You must be the owner of a database to set the permissions on its segments. If you are not the owner of a database but nevertheless have write access to it, you have the ability to create a segment in the database but not to modify its permissions. Since newly created segments allow all types of access to all categories of users, segments created by nonowners necessarily have a period of vulnerability, between creation time and the time at which the owner restricts access with os_segment::set_access_control().

See Chapter 7, Database Access Control, in ObjectStore C++ API User Guide.

os_segment_access::get_default()

os_int32 get_default() const;
Returns the types of access associated with the default group for the os_segment_access.

os_segment_access::get_primary_group()

os_int32 get_primary_group(
      os_char_const_p* group_name = 0
) const;
Returns the types of access associated with the primary group of the os_segment_access. The function sets group_name, if supplied, to point to the name of that group.

os_segment_access::no_access

This is one of three enumerators used to specify combinations of access types. They are used as arguments to some of the members of os_segment_access.

os_segment_access::operator =()

os_segment_access& operator =(
      const os_segment_access& source
);
Modifies the os_segment_access pointed to by this so that it is a copy of source, that is, so that it stores the same group name as source, and associates the same combinations of access types with the same groups. It returns a reference to the modified os_segment_access.

os_segment_access::os_segment_access()

os_segment_access();
Creates an os_segment_access that associates no_access with both the default group and the group named group_name.

os_segment_access(
      const char* primary_group,
       os_int32 primary_group_access_type,
       os_int32 default_access_type
);
Creates an instance of os_segment_access that associates primary_group_access_type with the group named primary_group, and associates default_access_type with the default group. primary_group_access_type and default_access_type are each os_segment_access::no_access, os_segment_access::read_access, or os_segment_access::read_write_access.

os_segment_access(
       const os_segment_access& source
);
Creates a copy of source, that is, it creates an os_segment_access that stores the same group name, and associates the same combinations of access types with the same groups.

os_segment_access::read_access

This is one of three enumerators used to specify combinations of access types. They are used as arguments to some of the members of os_segment_access.

os_segment_access::read_write_access

This is one of three enumerators used to specify combinations of access types. They are used as arguments to some of the members of os_segment_access.

os_segment_access::set_default()

void set_default(
      os_int32 access_type
);
Associates a specified combination of access types with the default group. access_type is os_segment_access::no_access, os_segment_access::read_access, or os_segment_access::read_write_access.

os_segment_access::set_primary_group()

void set_primary_group(
      const char* group_name, 
      os_int32 access_type
);
Associates a specified combination of access types with a group of a specified name. group_name is the name of the group. access_type is os_segment_access::no_access, os_segment_access::read_access, or os_segment_access::read_write_access.

void set_primary_group(
      os_int32 access_type
);
Associates a specified combination of access types with a group of an unspecified name. access_type is os_segment_access::no_access, os_segment_access::read_access, or os_segment_access::read_write_access.

os_segment_access::~os_segment_access()

The destructor frees memory associated with the deleted instance of os_segment_access.



[previous] [next]

Copyright © 1997 Object Design, Inc. All rights reserved.

Updated: 03/31/98 17:25:09