Custom module permission function I am creating a module whose purpose is to display some data. I have a input form that saves data to database; that data is then displayed to the user.

I have created a page where that data can be viewed, edited, and deleted.



My problem is that every user can see this. The best thing I have done is using the global $user variable, and verify that the currently logged-in user is the user who created the data being viewed. Every user could see the Edit and Delete tabs, even when no data was created.

I am trying to figure out how I use the permissions in the same way they are used with the content types, where users can edit any node of a content type, or can edit their own nodes of that content type.  

How could I resolve this issue?
You should implement hook_permission.
Then you will be able to add custom permissions to view, edit and delete for your custom form.  

Nice tip I'm using myself with Drupal is to open the code of one of Drupal's core/contrib modules that implements the same thing you need and learn how it was implemented there.