Code Monkey home page Code Monkey logo

Comments (6)

lprimak avatar lprimak commented on May 13, 2024 1

I feel very embarrassed

Absolutely no need. Your question prompted the cleanup of the code, it was indeed confusing, so thank you for your contribution!

Always ask questions!

from shiro.

fpapon avatar fpapon commented on May 13, 2024 1

@xian1295004710 don't worry, there is no stupid question! Thank you for asking and using Apache Shiro!
We hope you will add your first contribution soon :)
Don't hesitate!

from shiro.

xian1295004710 avatar xian1295004710 commented on May 13, 2024 1

I'm very glad to hear that (^o^), and thanks for your encouragement. It could make my day!

from shiro.

lprimak avatar lprimak commented on May 13, 2024

I don't see how... the variable is set to true only if any permission is present... hence the variable name.
Am I not seeing something you are seeing? In my view it looks like it works as designed

from shiro.

fpapon avatar fpapon commented on May 13, 2024

@xian1295004710 HasAtLeastOnePermission is always = true only for the latest valid permission of the list, if a check is false, the variable is not set, I think this is your misunderstanding.

The logic is that if we don't find any permitted permission in the list, we check the first permission to raise an error with a message related to the check.

Side note: We can optimize a little by adding a break into the loop after setting hasAtLeatOnePermission to true.

from shiro.

xian1295004710 avatar xian1295004710 commented on May 13, 2024

@lprimak @fpapon Thank you for taking time to answer the question very much. I am a newbie. I feel very embarrassed about that misunderstanding, I could run a test by myself, but I was too confident to ask that silly question, which makes your precious time wasted. I hope you don't mind.

from shiro.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.