Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Advanced User Permissions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Advanced User Permissions

    I would like to setup each form, in a desktop application, with advanced permission determined by who is currently logged in.

    Example: if John Smith is logged in, he can view the records in Form A, but he cannot delete a record.

    Jane Smith can view the records in Form B, but cannot edit or add new records.

    So the permissions would be: can they open the form, can they view the current records or only add new records, can they edit historic data and can they delete records.

    I am new to Alpha, and i know there is an option to put a password on a button. the problem arises when permissions change as personnel change positions. It would be a logistical nightmare to change the password for the button each time this occurs, disseminate the new password to all the appropriate peronnel and update the application. If i am wrong about how this work, please let me know.

    I never actually delete any records in any of my tables, i have a logical True/False that gets selected as opposed to deleting and then the form is set to filter those records. The administrator can, if he needed to, restore any records.

    i used to be able to create this in my sleep in the previous platform i used, but since moving to Alpha, i am having to re-learn the basics. (no regrets though)

    Appreciate any help.
    J.R.
    Epigate Software, LLC.

    [email protected]
    http://www.epigate.com
    sigpic

    #2
    Re: Advanced User Permissions

    You could create a table of users, forms, and activities. Once the user is logged in, opening a form would be controlled by reading the form and activity record for the logged in user. Permissions would be set according to the same record.
    There can be only one.

    Comment


      #3
      Re: Advanced User Permissions

      Some suggested reading:
      http://support.alphasoftware.com/alp...r_Database.htm

      http://support.alphasoftware.com/alp...and_Groups.htm

      http://support.alphasoftware.com/alp...ermissions.htm
      Andrew

      Comment


        #4
        Re: Advanced User Permissions

        Stan, that is what i did when i used the other platform. Thank You, i just need to figure the process in Alpha, and aschone, thank you for the links.
        J.R.
        Epigate Software, LLC.

        [email protected]
        http://www.epigate.com
        sigpic

        Comment


          #5
          Re: Advanced User Permissions

          Easiest way I've found to find the appropriate settings for a form is to use the Object Explorer. With the form in design mode, use the View manu, Object Explorer choice. Select the object you want to explore, here the form itself, and study the available options (properties) and their current settings.

          For example, to restrict a user from entering new records the xbasic is

          this.restrict_enter = .T.

          "this" being the form.

          Then you have to choose an event to which to attach the code. In your desired usage, probably the oninit event.
          Last edited by Stan Mathews; 02-21-2011, 03:39 PM.
          There can be only one.

          Comment


            #6
            Re: Advanced User Permissions

            Thank you Stan. This looks like what i am trying to do, but I am so new to Alpha that i will need to break out my de-coder ring to find out.

            Here is a shot of what we currently use in our app to control these permissions. each person has individual permissions for each object.



            I am determined to stick with Alpha no matter how many times i tell myself "I can do that in the other platform in a couple of minutes". But it is still a little frustrating at times to re-invent the wheel.
            J.R.
            Epigate Software, LLC.

            [email protected]
            http://www.epigate.com
            sigpic

            Comment


              #7
              Re: Advanced User Permissions

              Originally posted by J.R. Noe View Post
              Here is a shot of what we currently use in our app to control these permissions. each person has individual permissions for each object.
              She's a beauty!
              Peter
              AlphaBase Solutions, LLC

              [email protected]
              https://www.alphabasesolutions.com


              Comment


                #8
                Re: Advanced User Permissions

                Thanks Peter. I wish i had the Alpha version of this.
                J.R.
                Epigate Software, LLC.

                [email protected]
                http://www.epigate.com
                sigpic

                Comment


                  #9
                  Re: Advanced User Permissions

                  It's embarrasing, but I am so new I don't even know what "Bump" means.
                  J.R.
                  Epigate Software, LLC.

                  [email protected]
                  http://www.epigate.com
                  sigpic

                  Comment


                    #10
                    Re: Advanced User Permissions

                    J.R.,

                    "bump" is just a way of keeping this thread of messages near the top of the list of messages in this forum. It's often used when waiting for feedback from someone who's been participating in the discussion. Perhaps Stan is wondering how you're getting on with his suggestions...

                    Comment


                      #11
                      Re: Advanced User Permissions

                      OK, thank you Tom.

                      I have decided to utilize about the same thing as I created in the other app (in the other platform).

                      The users table will have all the pertinent information regarding the user, the child table (one-many) will have a list of each form/report. In the child table there will also be logical fields for each form/report consisting of "Access permission", "Add new permission", "Edit permission" and "Delete permission".

                      When the user logs in, a variable will hold the user ID, and when the user opens a form or report the variable will compare the user ID and the "Allow access permission" to see if the user has access permissions, if not, a message is diplayed explaining why. Also, when the form is opened, the table is checked to see if the user has Edit, Delete or Add new permissions.

                      I would like to set the buttons dependent on these permissions. If the user does not have Add new permissions, then the Add new record button is not enabled. Same with Delete, and so on.

                      I have created a table which captures the user info when logging in. User name, time and computer name is logged.

                      In the other app, i also had a tbale which logged each action, such as when a form or report is opened, by who, time and computer name, so i would like to also do this in Alpha.

                      Our main application, Ambutrax, has numerous accountability logs built in, requested by the customers, so eventually i will need to re-create all these in Alpha. (who needs a personal life anyway)

                      If someone thinks this is not the way to go or has a better way please let me know.

                      I looked at the built in security, and it is great. However, i think it would be difficult for the end user to manage. This may just be due to me being new and not fully understanding the built in security.

                      Comments/suggestions welcome.
                      J.R.
                      Epigate Software, LLC.

                      [email protected]
                      http://www.epigate.com
                      sigpic

                      Comment


                        #12
                        Re: Advanced User Permissions

                        Originally posted by J.R. Noe View Post
                        In the other app, i also had a tbale which logged each action, such as when a form or report is opened, by who, time and computer name, so i would like to also do this in Alpha.
                        For a headstart, here's a function that writes to an actions table. (op_trace is the name of the table). You can use or discard the logical return value as you see fit. You might use FILE_RW_SHARED in a networked situation.

                        Code:
                        FUNCTION op_write AS L (operation AS C, origin as C )
                        	op_tbl = table.open("op_trace",FILE_RW_EXCLUSIVE)
                        	op_tbl.enter_begin()
                        	op_tbl.Op = operation
                        	op_tbl.Date_op = time("mon dd, yyyy 0h:0m  am",now())
                        	op_tbl.Origin = origin
                        	op_tbl.enter_end(.t.)
                        	op_tbl.close()
                        	op_write = .t.
                        END FUNCTION
                        My usage is generally

                        Code:
                        Dim button_name as C
                        Dim form_name as C
                        button_name = this.name()
                        form_name = parentform.Name()
                        op_write(button_name,form_name)
                        Adding other parameters would be simple enough.
                        There can be only one.

                        Comment


                          #13
                          Re: Advanced User Permissions

                          I looked at the built in security, and it is great. However, i think it would be difficult for the end user to manage.
                          Again. Alpha is very flexible. You can build your own or you can use Alpha's built in security which is very comprehensive. If you want to use A5's security and still present a user friendly interface you will need to take advantage of A5's security functions. Either route you go is very doable.
                          Peter
                          AlphaBase Solutions, LLC

                          [email protected]
                          https://www.alphabasesolutions.com


                          Comment


                            #14
                            Re: Advanced User Permissions

                            Thank you for the code Tom. Very nice, just what i needed.

                            Peter, i looked more at the security functions you described and see that there would be a way to create a user administrative module for the end user to easily control the users and permissions. Thank you.
                            J.R.
                            Epigate Software, LLC.

                            [email protected]
                            http://www.epigate.com
                            sigpic

                            Comment


                              #15
                              Re: Advanced User Permissions

                              Stan, i used your code and it worked great for what i needed. I wanted to use the same thing to log other actions and used the same code, but added another parameter:

                              FUNCTION op_write AS L (operation AS C, origin as C, newvalue as C )
                              op_tbl = table.open("op_trace",FILE_RW_EXCLUSIVE)
                              op_tbl.enter_begin()
                              op_tbl.Op = operation
                              op_tbl.newval = newvalue
                              op_tbl.Date_op = time("mon dd, yyyy 0h:0m am",now())
                              op_tbl.Origin = origin
                              op_tbl.enter_end(.t.)
                              op_tbl.close()
                              op_write = .t.
                              END FUNCTION

                              And the button:

                              Dim button_name as C
                              Dim form_name as C
                              Dim yada_yada as C
                              button_name = this.name()
                              form_name = parentform.Name()
                              op_write(button_name,form_name,yada_yada)

                              Looks like it would work, but i get a message saying:
                              ________________________________________
                              Script:OnPush line:11
                              op_write(button_name,form_name,yada_yada)
                              op_write(button_name,form_name,yada_yada):Too many parameters
                              ________________________________________

                              Is there a limit on the number of parameters that can be passed, or is it the way i wrote it?
                              J.R.
                              Epigate Software, LLC.

                              [email protected]
                              http://www.epigate.com
                              sigpic

                              Comment

                              Working...
                              X