Skip to content

Bug: can() returns an error when user is not logged in #750

Description

@kibcode

PHP Version

8.1

CodeIgniter4 Version

4.3.5

Shield Version

1.0.0-beta.7

Which operating systems have you tested for this bug?

Windows, Linux

Which server did you use?

apache

Database

MySQL

Did you customize Shield?

No

What happened?

When i want to check permissions with can() and the user is not logged in shield produces an error. I always have to check with loggedIn() before using can().

Steps to Reproduce

Try to get a permission for guests.

Expected Output

can() should return false if a user is not logged in. It would also be nice to handle guests as a usergroup so users not logged in can have permissions too.

Anything else?

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions