Rights for running system procedures? - advantage-database-server

Can a non-adssys user run the system procedures?
I am developing a BizTalk WCF Adapter for Advantage that can be used and I need to browse and resolve the metadata. This is an add-in for Visual Studio, supporting .Net 2.0 or higher, that generates schemas and a binding file (wsdl). It can also generate classes that can be used in a WCF Service.
Our database has over 1000 tables, 50 views, and 50 procedures. We want to assign objects to a User ID and just return the objects belonging to the user.
Thanks,
Howard

Yes, non-adssys user can run the system procedures and use select to retrieve information from the system tables. Advantage uses a permission, and user/role based system to determine the user's access to the objects in the database. The user's permission will determine whether the procedure can be executed successfully or how much information are returned from the system tables.
This link provides the comprehensive information on the permission system in the Advantage data dictionary.
With regards to tables and views, to see the name of a table or view, the user must have at least the SELECT permission on the table a view. To modify table property such as constraint and index of a table the user must have ALTER permission to the table. For users who do not have ALTER permission to the table, those constrain objects and index objects are hidden from the them.
For stored procedures, the user must have EXECUTE permission on the procedure in order to see the name of the procedure.
The favored method for managing the permissions is to assign users to groups (roles), and grant permissions to the groups. User belonging to a group will inherit the permission from the group.

Conceptually, you might want to look at storing/retrieving the metadata from a descriptive table, then using THAT result to return your objects. You have a single point of access for all users using the ability to filter by SQL clause. Once you have the object data you can use a higher level permissioned "user" to return the objects without actually giving access to individual users. Just an idea.

Related

Can neo4j 3.* enterprise edition can control user data's access permission?

I'm using neo4j enterprise edition, and I found neo4j have no user data access control strategy, such as on user can grant some data's read/write permission to other user?
I found this: https://neo4j.com/docs/operations-manual/3.4-preview/security/authentication-authorization/subgraph-access-control/
The title is "Subgraph access control" but the content is control procedure's execution permission. It look likes have no relation with subgraph's access control...
I also found some people said that writing code to implement interface SecurityRole can resolve the problem, I can't found more information about this, is this right?
Thanks!
Subgraph access control is about restricting a user's ability to access the graph so that they can only go through the procedures granted to them. The code in the procedures should encapsulate the kind of queries you want them to be able to use, so either the procedures contain the queries in full, or it allows queries but performs filtering at some level.
While this can work, it may not have the right granularity for what you're trying to do, and it is a somewhat clunky approach.
Additional work is being done to fill in those gaps.
In the upcoming Neo4j 3.4, you will have the ability to restrict access to properties of nodes, though this is across all nodes, not just nodes of certain labels, and it will rely on a blacklist that is defined in the neo4j.conf file, so (at this point) requiring a restart to change which roles are blacklisted from accessing certain properties (though you should be able to grant roles to users through procs as usual, no restart needed).
There's more work to be done on this of course, it's just a matter of feature prioritization, so richer options are likely to be introduced in later releases.

Realm Mobile Platform: public, private and shared databases?

This question comes from the perspective of someone who's familiar with CloudKit and is moving to the Realm Mobile Platform.
With CloudKit we have the concept of private, public and shared databases. The private belongs to the user, the public can be seen by every user and the shared database is like a view into a user's private database used to share data between a limited number of users (friends).
Let's say I want to allow two users to collaborate on a project, user A will create the project and invite user B to collaborate, which mechanism would I use with realm to allow this, without completely opening up user A's private realm to user B (only the records specific to the project user A wants to share)?
Right now Realm permissions are granular to the database (Realm) level. There's no way to grant specific permissions that only apply to a subset of the data in a given Realm.
A high priority item on our roadmap are features to support working with partial copies of synced Realms. In the meantime, we'd recommend creating multiple private Realms for a given user to represent each subset of permissions. For example, you may have a truly private Realm for a given user, and one or more Realms for that user that represent data which can be shared with other users. In your specific case, you might want to create a Realm per project, rather than a Realm for all projects owned by a user.
As for actually granting permissions, you may create a RLMSyncPermissionValue object and pass it into the appropriate API on RLMSyncUser (e.g. -[RLMSyncUser applyPermission:callback:] or -[RLMSyncUser revokePermission:callback:]) to grant or revoke a permission. This requires knowing the identity of the user, which is generated by the Realm Object Server when the user is created.
You may also create a RLMSyncPermissionOffer object to represent an invitation by your user to another user to access their Realm (i.e. project). Such an object generates a string which can be passed to another user through a different channel (e.g. e-mail) and used to create a RLMSyncPermissionOfferResponse object to accept that offer.
Finally, in addition to the partial replication support I mentioned earlier we also have a few other items in the pipeline to make collaborative use of synced Realms easier; we hope to have more to share very soon.

Neo4J Multi Tenancy and Role Based Access to Nodes

I am trying to define a user management and permissions model for Neo4j. I have a web application (Angular 2) that connects to Neo4j via an API (KOANEO4J). Neo4j is the only database or persistent storage that the application uses. Through the application a user can add/edit/delete content which uses the API to carry out these instructions in Neo4j by running Cypher Statements. Up to now I have not worried about supporting multiple users but as a next step I am starting to think about this.
The product will be used by multiple different companies and each company will have multiple users so I need some way to support this. The model I am considering in Neo4J is as follows:
An "Orgaization" is represented by a node and it can have 1 or more "Organization Catalogs". All of the nodes belonging to that catalog will be children of one of the "Organization Catalogs".
Each user will also be represented by a node in the database. They will belong to an Organisation. They will have certain access permissions on an Organization Catalog identified by a an edge.
I am looking for some advice on whether or not this is an appropriate model to follow or if there are any examples or documents that describe how to achieve this in Neo4j.
If I do implement this model then would it be better to model the permissions as seperate nodes so a user is connected to a permission node (e.g. Read Only Access) that is then connected to the Organization Catalog.
Any suggestions on how I would actually get the API to work with this type of model. I'm sure I can pass the User Id to Neo4j as part of each query and then filter the results to show only nodes the user has access to but this doesn't seem like a very elegant solution - it also means that all of the security would be dependant on carefully written Cypher queries that don't leak data that a user isnt supposed to access.
Thanks a lot
I am looking for some advice on whether or not this is an appropriate
model to follow or if there are any examples or documents that
describe how to achieve this in Neo4j.
The answer for this question is: it depends. Remember that when modelling a graph database you should consider the queries that are asked to the database. If this model fits the queries that you are asking to the database then this model is appropriated, otherwise, not. Take a look in the Chapter 5 (Graphs in the Real World) of the book Graph Databases (by Ian Robison, Jim Webber and Emil Eifrem. Available for download here). This chapter shows the modelling process of an Authorization and Access Control system in Neo4j. Can be enlightening and helpful to you.
If I do implement this model then would it be better to model the
permissions as seperate nodes so a user is connected to a permission
node (e.g. Read Only Access) that is then connected to the
Organization Catalog.
Again, it depends. Do it if the Permission entity has connection to others entities of your application besides an User and an Organization Catalog. Otherwise I believe that your permission can be modeled as a relationship between an user and an organization catalog.
Any suggestions on how I would actually get the API to work with this
type of model. I'm sure I can pass the User Id to Neo4j as part of
each query and then filter the results to show only nodes the user has
access to but this doesn't seem like a very elegant solution - it also
means that all of the security would be dependant on carefully written
Cypher queries that don't leak data that a user isnt supposed to
access.
Maybe is a good idea add another layer of software between your AngularJS client app and the Neo4j database. This way in this new layer of software (a Node.js application, for example) you can implement a access control system, then verifiy if the authenticated user can access the resource that is being requested.

Subgraph access control

In the official Documentation (3.1: http://neo4j.com/docs/operations-manual/current/security/authentication-authorization/subgraph-access-control/)
It is said
"For example, a user can be allowed to read, but not write, nodes labelled with Employee and relationships of type REPORTS_TO"
But nowhere it's written in this page and others how to do it.
With the "call dbms.procedures()" we can see many more function in the enterprise edition but nothing about defining this Subgraph control
We think on changing the an enterprise edition, but if we are sure to be able to do that.
Can anyone explain me or gives me the address of the relevant documentation
Thanks
The documentation is all right there. Note the first sentence:
Through the use of user-defined procedures and custom roles, an
administrator may restrict a user’s access and subsequent actions to
specified portions of the graph.
The approach seems to be, for users without write permission, create roles for them as appropriate, then create (or use existing) user-defined procedures to do what operations they are allowed to do. Then configure the permissions of the procedures to the appropriate level, and associate the roles of the procedures (by modifying dbms.security.procedures.roles) with the roles you previously created. This allows the procedures you created to be executed by the roles you associated it with.
For example, given an HR user, who does not have write permissions, you could create a procedure to create or delete a :REPORTS_TO relationship between :Employee nodes. The procedure would need to be set to mode=WRITE since it needs write access. This would normally not be executable by this HR user, since they don't have write permissions.
But if you created a role, say 'hr', and added that role to this user, and set the procedure to be accessible by the hr role in dbms.security.procedures.roles, then the hr user could execute this procedure, and it would perform the necessary write operations.
In summary, Neo4j's subgraph access control isn't defined on the nodes or labels themselves, nor does it apply when executing write statements in Cypher. This access control is specific to user-defined procedures, and allows users with certain roles (where that role is associated with those procedures) to execute those procedures even if they normally would not be able to due to their access level.
EDIT
One final thing that could work for you...Neo4j has a means of registering transaction event handlers that can perform checking and logic on a transaction in progress, and reject if some criteria are not met. I would assume you could get a user's roles here, and probably check the transaction for writer operations on certain labels. Odd that this wasn't referenced in the securing the subgraph section of the documentation. I haven't tried this approach myself (I'll try my own testing later) so I'm not sure if it will fulfill what you need, but it's worth a look.
UPDATE:
It's been awhile, but we do have a more comprehensive means of access control coming to the upcoming Neo4j 4.0.
4.0 will include schema-based security, full ability to define, per user and role, the ability to grant or deny various levels of permissions (read, write, traverse, and more) for nodes and relationships of specific types. So for example you can have various roles that only have visibility on certain kinds of nodes, or are specifically denied visibility on others. You can also restrict whether certain nodes can be traversed through at all.
This should fulfill the needs of everyone who has been waiting for a more comprehensive security and access solution in Neo4j.
Here's the Neo4j 4.0 MR2 documentation, more to come as we approach the official 4.0 release!

Possible to get access to SP

If I create a store procedure, named test, that contains lots of different columns from many different tables.
I wanna let 20 users to get access to the data with stored procedure via excel.
My question is:
Is it possible to make the user to get access only to the store procedure, test, only? Users shall not have access to table or view. Store procedure test only. I'm using SQL server 2008 R2 standard
http://msdn.microsoft.com/en-us/library/ms188371.aspx access to the single stored procedure and no permissions to the table.
Grant EXECUTE On [SpName] To [Principal]
There is no such concept as a read permissions to a table for a stored procedure. Stored procedure permissions are separate from other objects. If a user has permission to run a stored procedure, they can run it no matter what it does, even if they don't have permission to the underlying objects

Resources