There are two types
of FedSQL views for SAS Federation Server:
-
Invoker's rights: An invoker's rights view is run
with the invoking user's credentials.
-
Definer's rights: A definer's rights view is run
with the credentials of the schema owner.
The invoker view is
accessed using the current user’s authorization, credentials,
and login information while the definer's rights view is accessed
using the schema owner’s authorization, credentials and login
information. A definer's rights view is always
associated with a schema owner.
Definer’s rights
views allow security to be managed more simply from a single layer
of data, which in turn provides for a more secured system. For example,
there are 100 tables that provide data to a set of users. 10 views
are created and their data is acquired from the 100 tables. The users
are selecting from the 10 views to get their data. With invoker's
rights views, each invoker must have access to the 100 tables. This
includes setting privileges in SAS Federation Server,
and ensuring that each invoker has a login to the data sources containing
the 100 tables.
With definer's rights
views, the data available through the view is accessed by a single
user only: the schema owner. Therefore, only this user, the schema
owner, needs server privileges and database logins to the data sources
containing the 100 tables. View invokers do not need direct access
to the underlying tables. The administrator can secure the definer's rights
view using Federation Server SQL authorizations
to control which users and groups have access to the view’s
result set. Unless explicitly specified as definer views, views are
created as invoker views.
Here is an example of
creating an Invoker view:
CREATE VIEW
view1 AS SELECT * FROM table1
Definer's rights views
are required for data caching. Only a schema owner can create a definer’s
rights view for a schema that he owns. A non-schema owner cannot
create a definer’s rights view for a schema that he is allowed
to select from. Create a definer view using the following example
syntax:
CREATE VIEW
view1 SECURITY DEFINER AS SELECT * FROM table1
The following example
alters an existing view to invoker's rights or definer's rights. If
a definer view has any associated cache, it will be dropped when the
view is changed to Invoker.
ALTER VIEW
view1 SECURITY INVOKER
ALTER VIEW
view1 SECURITY DEFINER