Monday, 13 May 2013

Best Practice for Xataface Permissions : NO ACCESS Unless ....

Xataface has a rich permissions system that offers quite a bit of flexibility in how you implement permissions.  A typical pattern for implementing permissions in Xataface is to add a "role" field to the users table to specify the user's role, and use this inside your getPermissions() methods to help determine what permissions should be granted to the user.

Many developers will take this pattern and then implement a getPermissions() method in their application delegate class similar to the following:

To summarize this strategy, it entails:

  1. Returning the permissions assigned to the current user's role (which would be defined in the permissions.ini file).
  2. Returning no permissions if either the user isn't logged in or they don't have value in their 'role' field.
While this approach may work, it could open up some security holes if you're not very careful.  Since you have defined the permissions in the application delegate class, these will be used as the default permissions for every table in the database.  If you have some tables that include private information (which will likely be the majority of your tables), you would need to explicitly provide more limited permissions on each of those tables individually by implementing getPermissions() methods in their respective delegate classes.

A Better Approach : Default NO ACCESS; Grant More As Needed

A better approach would be to grant NO ACCESS to all users, except for administrative users, at the application level.  Then you can grant additional permissions as needed at the table level.  E.g.
This grants users with a role of 'ADMIN', all permissions in the system, and no access to anyone else.

26 comments:

  1. I have two tables. One a users table and one I want anyone to see at anytime regardless of whether they are logged in or not.

    We have interns, I gave them edit permissions but I don't want them to have access to the users table. And I don't want anyone who isn't logged in to see the users table.

    SO I am following your best practices am not sure how to proceed once am ready to work in the tables directory.

    I have been through a lot of the website today and have come close to getting what I need but am about three feet from my goal.

    Can you give me a link to the part that talks about setting up permissions under the table directory?

    Thanks.

    ReplyDelete
    Replies
    1. Never mind. I just needed rest. Nailed it!

      Delete
    2. Hi everyone I'm Olivia Hannah and am here to share the wonderful work Dr Raypower did for me. After 5 years in marriage with my husband with 2 kids, my husband started acting weird and going out with other ladies and showed me cold love, on several occasions he threatens to divorce me if I dare question him about his affair with other ladies, I was totally devastated and confused until a old friend of mine told me about a spell caster on the internet called Dr. Raypower who help people with relationship and marriage problem by the powers of love spells, at first I doubted if such thing ever exists but decided to give it a try, when I contact him, he helped me cast a love spell and within 48hours my husband came back to me and started apologizing, now he has stopped going out with other ladies and his with me for good and for real. Contact this great love spell caster for your relationship or marriage problem to be solved today via email: Urgentspellcast@gmail.com or Urgentspellcast@yahoo.com or Call or WhatsApp: +14243308109. 

      Read more about him on his website: http://urgentspellcast.website2.me/














      Hi everyone I'm Olivia Hannah and am here to share the wonderful work Dr Raypower did for me. After 5 years in marriage with my husband with 2 kids, my husband started acting weird and going out with other ladies and showed me cold love, on several occasions he threatens to divorce me if I dare question him about his affair with other ladies, I was totally devastated and confused until a old friend of mine told me about a spell caster on the internet called Dr. Raypower who help people with relationship and marriage problem by the powers of love spells, at first I doubted if such thing ever exists but decided to give it a try, when I contact him, he helped me cast a love spell and within 48hours my husband came back to me and started apologizing, now he has stopped going out with other ladies and his with me for good and for real. Contact this great love spell caster for your relationship or marriage problem to be solved today via email: Urgentspellcast@gmail.com or Urgentspellcast@yahoo.com or Call or WhatsApp: +14243308109. 

      Read more about him on his website: http://urgentspellcast.website2.me/

      Delete
  2. Welcome to the forum! Very nice to meet you.

    Quincy

    ReplyDelete
  3. Hello i am here to spread this good news to the entire world on how i got my ex love back.I was going crazy when my love left me for another girl last month,But when i meet a friend that introduce me to DR IROSI the great messenger to the oracle that he serve,I narrated my problem to DR IROSI about how my ex love left me and also how i needed to get a job in a very big company.He only said to me that i have come to the right place were i will be getting my heart desire without any side effect.He told me what i need to do,After it was been done,In the next 2 days,My love called me on the phone and was saying sorry for living me before now and also in the next one week after my love called me to be pleading for forgiveness,I was called for interview in my desired company were i needed to work as the managing director..I am so happy and overwhelmed that i have to tell this to the entire world to contact DR IROSI at the following email address DRIROSISOLUTIONCENTER@GMAIL.COM and get all your problem solve..No problem is too big for him to solve..Contact him direct on DRIROSISOLUTIONCENTER@GMAIL.COM or call his mobile number or add him up on whatsapp via (+2348118829771). and get your problems solve like me.    

    ReplyDelete
  4. Hi everybody. I recently saw a testimony about chief dr lucky in a blog I visit for relationship and dating counseling problems because i had been having serious issues with my boyfriend and we had been dating for six months, he just suddenly changed, he wasn't returning my calls,he started cheating,he was hurting me in many ways i never thought possible and I just thought I should try it*maybe out of desperation of some sort*..and I contacted chief dr lucky ..At first everything felt dreamy and unbelievable, his consultations and solution was a little bit easy and strange and I was scared a little cause I heard read and heard lots of stories to of fake spell casters,scams and i never really believed in magic..I played along with a little hope and and faith and I sent some few stuffs after everything and it worked like a miracle,everything went to a while new direction,it was and is amazing...I guess it was all good faith that made me read That particular post that faithful day..I hope he could help other people too like he did me...I did a little and I got everything I wanted and wished for*my husband,my family and my life back. E-mail: Cheifdrlucky@gmail.com or contact him on whats App him +2348132777335 Website :http://chiefdrluckysolutionhome.website2.me/  

    ReplyDelete
  5. LOVE SPELLS THAT WORKS I am sharing this testimony to partners suffering in their relationships because there is an enduring solution.
    My husband left me and our 2 kids for another woman for 3 years. I tried to be strong just for my kids but I could not control the pains that torment my heart. I was hurt and confused. I needed a help, so i did a research on the internet and came across a site where I saw that Dr. Aluya a spell caster, can help get lovers back. I contacted him and he did a special prayer and spells for me. To my surprises, after some days, my husband came back home. That was how we reunited again and there was a lot of love, joy and peace in the family.
    You can as well contact Dr.  Aluya  , a powerful spell-caster for solutions on his contact aluya.48hoursspelltemple@gmail.com or directly on Whats App: +2348055431163 

    ReplyDelete
  6. I completely trusted Dr Osofo totally from the time I spoke with him during the period my husband Left me after 7 years of our marriage, He started the spell work on my husband, and gave me so much assurance and guaranteed me that he was going to bring my husband back to my feet in just 48 hours of the spell casting. I was so confident in his work and just as he said in the beginning, my husband is finally back to me again, yes he is back with all his hearts, Love, care, emotions and flowers and things are better now. I would have no hesitation to recommend this powerful spell caster to anybody who is in need of help.. E-mail; (osofo.48hoursolutioncenter@gmail.com )  Or add him up on whatapps; +2349065749952

    ReplyDelete
  7. I completely trusted Dr Osofo totally from the time I spoke with him during the period my husband Left me after 7 years of our marriage, He started the spell work on my husband, and gave me so much assurance and guaranteed me that he was going to bring my husband back to my feet in just 48 hours of the spell casting. I was so confident in his work and just as he said in the beginning, my husband is finally back to me again, yes he is back with all his hearts, Love, care, emotions and flowers and things are better now. I would have no hesitation to recommend this powerful spell caster to anybody who is in need of help.. E-mail; (osofo.48hoursolutioncenter@gmail.com )  Or add him up on whatapps; +2349065749952

    ReplyDelete
  8. I want to use this great opportunity to thank Dr Aluya for helping me to get my boyfriend back after 3 months of breakup. My boyfriend breakup with me because he see another girl at his working place and told me he is no longer interested in me and live me in pain and heart break. I seek for help on the internet and i saw so many good talk about this great spell caster Dr Aluya and I contacted him also and explain my problems to him and he cast a love spell for me which i use to get back my boyfriend within the period of 48 hours and i am so grateful to him for the good work he did for me,that is why i also want to let everyone who is in need of help out there to also seek help from him so he can help.His email is aluya.48hoursspelltemple@gmail.com or whatsapp: +2348110493039

    ReplyDelete
  9. My name is Louis Edmond, I am from USA. I want to share a testimony about Dr Aluya, a great spell caster who is very straight forward with his words of casting spells. When my Wife left me for another Man i was so confused,but one a day a friend of mine gave me the email address of this great spell caster called dr Aluya, I contacted this man and explained to him all that i was going through,he then told me to be calm and not worry anymore because my case is a very easy one. At first I never believed all that he was saying until when my husband returned home two days later begging me to forgive him for all that he had done to me and to please accept him back into my life,I was so amazed,I never believed it was going to happen that fast.
    This man is truly great indeed. Contact him today for a perfect solution to your love problem, aluya.48hoursspelltemple@gmail.com.  or whatsApp him  +2348110493039

    ReplyDelete
  10. My first time meeting with a Psychic medium and I have to say, it's really worth it. It had been 5months since my husband left me without saying anything.All thanks to Dr Okiti I was able to connect with my husband again with his powerful reunion love spell and now he loves me more than he used to. Eternally grateful with The Great Dr Okiti I highly recommend, His email l :Okitilovespelltample@gmail. com

    ReplyDelete
  11. Hi everyone, my name is Rabueil Islam
     and am from London, I met this spell caster called Dr Aluya of aluya.48hoursspelltemple@gmail.com online and so many other, but i decided to go with this particular spell caster and this is about 2 weeks ago. I needed the spell caster to reunite me and my lover because she started behaving strange and a day came she text me and told me she cannot continue with the relationship anymore, that she just want to be alone. But a close friend of hers shows the guy to me that she was now dating. So i contacted this spell caster because i was totally heart broken and i smoked and get drunk till i could not even notice if am standing or lying.This spell caster told me not to worry, he gave me hope that am to have her again just like old times, and i provided all the requirements, and in just 5 days, my ex lover called me crying over the phone asking for me to forgive her for her stupid act, and she swore with her mother grave to love me and never hurt me again.This was what the spell caster earlier told me and it came after he has done the spell and that same night, my lover came to my house and spend the night with me.I have never seen spell as powerful as this but now, am convinced that Dr Aluya is the best ever, You can contact him through him email address:aluya.48hoursspelltemple@gmail.com or WhatsApp: +2348110493039

    ReplyDelete
  12. My lover dumped for  another woman with two kids i was confused until i came
    in contact with Dr Aluya who helped me with a powerful love spell that
    brought him back within 2 days. contact Dr Aluya for help on :
    Email :aluya.48hoursspelltemple@gmail.com or WhatsApp him  +2348110493039

    ReplyDelete
  13. Get Your Wife Back, Perfect Urgent Love Spell. Am Oliva Giphy
     from FL Usa All Thanks To Dr Aluya Who Brought Back The Love Of My Life. my girlfriend cheated on me and asked for a breakup. I don't believe at first i try to get back with her but all she told me was she’s with someone else. that she is no longer interested in marrying me at that point i was heart broken coz i love my girlfriend so much that i could not let go off her all of a sudden she left me, i really love her and never can imagine my life without her. not until i came across a powerful real spell caster Dr Aluya who promise me 48hours urgent love spell to get back with my girlfriend, good twenty-four {48} hours. hmm-mm, it was a good night time at 11:pm within the days that Dr Aluya told me that my girlfriend will be back, at first i heard the bell rings getting close to my door i heard someone saying honey!!!, it sound familiar i opened the door and i saw my girlfriend standing and weeping in front of me. i was not surprised because its all i have been praying for her to come back home. Guess what 2 weeks after she noticed her system and her body temperature was changed and i took her to clinic for check up and the doctor told me that there is life in her which means she was pregnant i really wants to use this opportunity to thanks Dr Aluya so much and the love page that directed me to Dr Aluya if you have any problem getting your ex back, or predicament that is worse or exactly like this you have been into, contact Dr Aluya on aluya.48hoursspelltemple@gmail.com Whatsapp/cal  +2348110493039  
    https://draluya48hoursspelltemple.webs.com/

    ReplyDelete
  14. My lover dumped another woman with two kids i was confused until i came
    in contact with Dr Aluya who helped me with a powerful love spell that
    brought him back within 2 days. contact Dr Aluya for help on :
    Email :aluya.48hoursspelltemple@gmail.com or aluya.48hoursspelltemple@yahoo.com WhatsApp him +2348110493039


    website https://draluya48hoursspelltemple.webs.com/

    ReplyDelete
  15. How I Got My Ex Husband Back..Am so excited to share my testimony of a real spell caster who brought my husband back to me. My husband and I have been married for about 6 years now. We were happily married with two kids, a boy and a girl. 3 months ago, I started to notice some strange behavior from him and a few weeks later I found out that my husband is seeing someone else. He started coming home late from work, he hardly care about me or the kids anymore, Sometimes he goes out and doesn't even come back home for about 2-3 days. I did all I could to rectify this problem but all to no avail. I became very worried and needed help. As I was browsing through the internet one day, I came across a website that suggested that Dr Aluya can help solve marital problems, restore broken relationships and so on. So, I felt I should give him a try. I contacted him and and told him my problems and he told me what to do and i did it and he did a spell for me. 48 hours later, my husband came to me and apologized for the wrongs he did and promise never to do it again. Ever since then, everything has returned back to normal. I and my family are living together happily again.. All thanks to Dr Aluya Powerful Love Spell that really works. If you have any problem contact him and i guarantee you that he will help you. He will not disappoint you. Email him at: {aluya.48hoursspelltemple@gmail.com}. or  {aluya.48hoursspelltemple@yahoo.com} whatsapp him on: +2348110493039  
      https://draluya48hoursspelltemple.webs.com/  

    ReplyDelete
  16. This is a testimony that i will tell to every one to hear. i have been married four 2 years and on the fifth year of my marriage, another man had a spell to take my lover away from me and my wife left me and the kids and we have suffered for 2 years until i meant a post where this man Dr, Aluya have helped someone and i decided to give him a try to help me bring my love wife home and believe me i just send my picture to her and that of me and after 15hours as he have told me, i saw a car drove into the house and behold it was my wife and she have come to me and the kids and that is why i am happy to make every one of you in similar to met with this man and have your lover back to your self His email:aluya.48hoursspelltemple@gmail.com   OR   aluya.48hoursspelltemple@yahoo.com      https://draluya48hoursspelltemple.webs.com/
    WhatsApp him at (+2348110493039)thank so much.

    ReplyDelete

  17. How I Got My Husband Back..........
    THE BEST WAY TO Win And Get Your Ex HUSBAND WITH THE HELP OF PROPHET OYINBO POWERFUL AND URGENT LOVE SPELL WITH 100% GUARANTEE My husband abandon me for the the past months now, and refuse to come back because he was hold on by a woman whom he just met, for that, i has been suffering and it has been heel of a struggle, but I decide to do all means to make sure that my husband and i come back together as it use to, then I went online there I saw so many good talk about this spell caster whose email is prophetoyinbojesus@gmail.com so I had to contact him and explain my problem to him and in just 48 hours as he has promised, my husband came home and his behavior was back to the man i got married to. I cant thank the spell caster enough for what he did for me, i am so grateful and i will never stop to publish his name on the internet for the good work he has done for me,once again his email him direct..prophetoyinbojesus@gmail.com or Call/WhatsApp:+2348074066640


    ReplyDelete
  18. I trusted Dr dodo totally from the time I spoke with him during the period my husband Left me after 7 years of our marriage, He started the spell work on my husband, and gave me so much assurance and guaranteed me that he was going to bring my husband back to my feet in just 48 hours of the spell casting. I was so confident in his work and just as he said in the beginning, my husband is finally back to me again, yes he is back with all his hearts, Love, care, emotions and flowers and things are better now. I would have no hesitation to recommend this powerful spell caster to anybody who is in need of help.. E-mail; drdodotemple @ gmail com or whatsapp him on +1 (706) 871-4571

    ReplyDelete
  19. Dr. Obodubu Monday is recognised all over the world of marine kingdom, As one of the top fortunate and most powerful native doctor of charms casts from the beginning of his ancestors ship until now Dr. Obodubu Monday lives strong among all other native doctors, there have never been any form of impossibility beyond the control of Dr. Obodubu Monday it doesn't matter the distance of the person with the problems or situation, all you have to do is believe in the native doctor Dr. Obodubu Monday cast that works, he always warns never to get his charms cast if you do not believe or unable to follow his instruction. it is the assignment of the native doctor Dr. Obodubu Monday to offer services to those in need of spiritual assistance not minding the gravity of your situations or distance as long as water, sea, ocean, lake, river, sand, etc. are near you, then your problems of life would be controlled under your foot. if you need any spiritual help on any of these call Doctor Obodubu on :+2349058774809
    Get Your Love Back
    Fruit Of The Womb
    Fibroid
    Business Boom
    Financial Breakthrough
    Get Rich Without Ritual
    Do As I Say
    Bad Dream
    Promise And Fail
    Epilepsy
    Land/Court Case
    Mental Disorder
    Political Appointment
    Visa Approval
    Cancer
    Examination Success
    Spend And Get Back
    Good Luck
    Natural Neath
    Hypertension
    Stroke
    Sickle cell
    Impotency
    Win Court case
    Promotion At Work
    Commanding Tone
    Protection Ring
    Marriage Success
    Love Ring
    Favour Ring
    Recover Lost Glory
    Spiritual Power For Men Of God
    Travel Success Ring
    Job Success
    Lotto/Pool Win/betnaija win
    And Many
    More make haste to call or Or WhatApp Baba Doctor Obodubu Monday on +2349058774809 for spiritual problem today and you will surely get solution to all your predicament

    ReplyDelete
  20. Dr. Obodubu Monday is recognised all over the world of marine kingdom, As one of the top fortunate and most powerful native doctor of charms casts from the beginning of his ancestors ship until now Dr. Obodubu Monday lives strong among all other native doctors, there have never been any form of impossibility beyond the control of Dr. Obodubu Monday it doesn't matter the distance of the person with the problems or situation, all you have to do is believe in the native doctor Dr. Obodubu Monday cast that works, he always warns never to get his charms cast if you do not believe or unable to follow his instruction. it is the assignment of the native doctor Dr. Obodubu Monday to offer services to those in need of spiritual assistance not minding the gravity of your situations or distance as long as water, sea, ocean, lake, river, sand, etc. are near you, then your problems of life would be controlled under your foot. if you need any spiritual help on any of these call Doctor Obodubu on :+2349058774809
    Get Your Love Back
    Fruit Of The Womb
    Fibroid
    Business Boom
    Financial Breakthrough
    Get Rich Without Ritual
    Do As I Say
    Bad Dream
    Promise And Fail
    Epilepsy
    Land/Court Case
    Mental Disorder
    Political Appointment
    Visa Approval
    Cancer
    Examination Success
    Spend And Get Back
    Good Luck
    Natural Neath
    Hypertension
    Stroke
    Sickle cell
    Impotency
    Win Court case
    Promotion At Work
    Commanding Tone
    Protection Ring
    Marriage Success
    Love Ring
    Favour Ring
    Recover Lost Glory
    Spiritual Power For Men Of God
    Travel Success Ring
    Job Success
    Lotto/Pool Win/betnaija win
    And Many
    More make haste to call or Or WhatApp Baba Doctor Obodubu Monday on +2349058774809 for spiritual problem today and you will surely get solution to all your predicament

    ReplyDelete
  21. I was searching for help on the internet to get my ex husband back after he divorced me 5 months ago, i came across so many testimonies from different people and they are all talking about this wonderful man called Doctor ODIBOH DADA on how he help them to save their marriage and relationships and i also contact him on his email (odibohsolutionhome@gmail.com) and explain my problem to him and he did a nice job by helping me to get my divorced husband back within 3 days and later on i got pregnant for him, for we have been married for 6 years no pregnancy .. I never believe that such things like this can be possible but now i am a living testimony to it because Doctor ODIBOH DADA actually brought my lover back and also help me got pregnant, If you are having any relationship problems or any problem concerning life itself why not contact Doctor ODIBOH DADA for help via his email: odibohsolutionhome@gmail.com or whatsapp +2347048883838. Then i promise you that after all said and done you will have reasons to celebrate just like me.

    ReplyDelete
  22. I really want to thank Dr Emu for saving my marriage. My wife really treated me badly and left home for almost 3 month this got me sick and confused. Then I told my friend about how my wife has changed towards me then she told me to contact Dr Emu that he will help me bring back my wife and change her back to a good woman. I never believed in all this but I gave it a try. Dr Emu casted a spell of return of love on her, and my wife came back home for forgiveness and today we are happy again. If you are going through any relationship stress or you want back your Ex or Divorce husband you can contact his whatsapp +2347012841542 or email emutemple@gmail.com 

    ReplyDelete
  23. Hi, this is real testimony of a spell doctor who helped me bring back my fiance, who left i and the kids for 9 month. I had lost all hope about my fiance coming back home again. if you’re going through a tough time in your marriage or relationship, or want back your Ex. contact him on: aluya.48hoursspelltemple@gmail.com   or whatsapp  +2348110493039   you can contact him on his web     https://draluya48hoursspelltemple.webs.com/   

    ReplyDelete
  24. Good news!

    Do you need an urgent loan to settle all kinds of debt? If you need any urgent credit please contact us today. We issue loans ranging from $ 2,000 dollars to $ 100,000,000.00 dollars to any interested individual, boards, schools, churches, with a minimum interest rate of 2% per annum. contact loan processing officer using your corporate email: (inforamzanloan@gmail.com) God Bless

    Credit Offer

    ReplyDelete