I've just created a module that concerns books (add book, edit books, etc). Of course the administrator can use it, but I want to allow users that are connected to use it as well. But with condition on uid like so:
- User1: add book 1, book 5, book 7
- User2: add book 3
- ...
The administrator can see all books (1,3,5,7) (that's done). But user1 (which is not superuser user/1
...) has to only see his/her books (1,5,7), and similar for user2.
I'm sure I have to add a condition on my current module like:
if (uid = current user id) then show only user1's books)
But how to do that?
I know that the table "node" contains both informations of user id and nid (all books).
Note: I want to do that without using the Views module.